Retrieve Timezone from GPS DateStamp GPS TimeStamp

Started by bongo, August 05, 2013, 12:38:02 AM

Previous topic - Next topic

bongo

In the GPS Tags documentation it states for the GPSDateStamp and GPSTimeStamp that the value returned is adjusted to UTC if a timezone is present.  How do I get the timezone value?

I'd prefer to get the GPS DateTimeStamp with the timezone information if present.

Thanks, Steve

Phil Harvey

Hi Steve,

The system time zone may be seen in the system date/time tags like FileModifyDate.

As you have mentioned, the GPSDateTime is in UTC.  You could create a user-defined tag to report this in the system time zone:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        GPSDateTimeLocal => {
            Require => 'GPSDateTime',
            Groups => { 2 => 'Time' },
            ValueConv => 'ConvertUnixTime(GetUnixTime($val),1)',
            PrintConv => '$self->ConvertDateTime($val)',
        },
    },
);
1;  #end


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bongo

Thanks Phil.  Is there a risk that the system time zone in FileModifyDate may be different than the GPS captured time zone?  The scenario I am thinking of is the case where a photograph, with GPS, is taken in Italy, but I modify the file afterwards in NY.  Will the FileModifyDate retain the GPS capture timezone or would it be the time zone in NY as in the sample scenario.

Or is the user-defined tag that you describe below the way to push the timezone into FileModifyDate?

Thanks again for your help.

Phil Harvey

The technique I used will keep the correct global time.

But I'm thinking now that maybe you didn't want to adjust the GPSDateTime to the local time zone.  You confuse me when you talk about a GPS capture time zone because the GPS times are always in UTC.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).