ExifTool Forum

General => Metadata => Topic started by: bongo on August 05, 2013, 12:38:02 AM

Title: Retrieve Timezone from GPS DateStamp GPS TimeStamp
Post by: bongo on August 05, 2013, 12:38:02 AM
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
Title: Re: Retrieve Timezone from GPS DateStamp GPS TimeStamp
Post by: Phil Harvey on August 05, 2013, 06:57:10 AM
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 (https://exiftool.org/config.html) 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
Title: Re: Retrieve Timezone from GPS DateStamp GPS TimeStamp
Post by: bongo on August 06, 2013, 07:45:04 PM
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.
Title: Re: Retrieve Timezone from GPS DateStamp GPS TimeStamp
Post by: Phil Harvey on August 07, 2013, 07:53:00 AM
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