ExifTool Forum

General => Metadata => Topic started by: nq270 on June 14, 2022, 10:43:33 PM

Title: GPS Date and Time incorrect
Post by: nq270 on June 14, 2022, 10:43:33 PM
I'm using a Nikon D500 with SnapBridge on my mobile for gps information.

The picture taken will show Date/Time as 15/06/2022 7:12:59am
But gps information show GPS Datestamp as 2022:06:14 and GPS Timestamp as 23:12:38.
Date/Time is 8 hours behind gps-date and time.

My mobile phone (Samsung Galaxy) is set to Automatic Time Zone and Set Timezone Based on Location.
How would I be able to adjust gps date/timestamp to correspond with the image date/timestamp ?

Any help and suggestion greatly appreciated, thanks
Title: Re: GPS Date and Time incorrect
Post by: StarGeek on June 15, 2022, 12:44:20 AM
What is the output of this command.  Copy/paste the results here and use the Code Button (https://exiftool.org/forum/index.php?topic=4888.msg69111#msg69111) for formatting
exiftool -time:all -G -a -s file.jpg
Title: Re: GPS Date and Time incorrect
Post by: nq270 on June 15, 2022, 04:32:13 AM
Thanks StarGeek
I'll give this a try
Thanks again
Title: Re: GPS Date and Time incorrect
Post by: wywh on June 15, 2022, 04:45:19 AM
Quote from: nq270 on June 14, 2022, 10:43:33 PM
Any help and suggestion greatly appreciated

I usually don't pay any attention to GPS timestamps but a few years ago in a London vacation trip I had some iPhone 5 and Canon 6D images that sorted incorrectly in Mac's Photos.app (GPS locations, timezones and movie timestamps are also flies in that ointment ... and with a certain workflow (the upcoming GraphicConverter 11.6.2 update should fix this) the IPTCDigest gets out-of-sync so some of my apps pick the datetime from IPTC or XMP-photoshop instead 'ExifIFD:DateTimeOriginal'...).

Maybe the devices did not get proper GPS signal indoors so they used an older GPS timestamp, or maybe timezones caused this to some images:

exiftool -a -G1 -s -time:all 2015-0801-2132-08.jpg
[System]        FileModifyDate                  : 2015:08:01 21:32:08+03:00
[System]        FileAccessDate                  : 2022:06:15 11:36:04+03:00
[System]        FileInodeChangeDate             : 2022:06:15 11:36:03+03:00
[IFD0]          ModifyDate                      : 2015:08:09 20:05:43
[ExifIFD]       DateTimeOriginal                : 2015:08:01 21:32:08
[ExifIFD]       CreateDate                      : 2015:08:01 21:32:08
[ExifIFD]       SubSecTimeOriginal              : 73
[ExifIFD]       SubSecTimeDigitized             : 73
[GPS]           GPSTimeStamp                    : 19:31:28.5
[GPS]           GPSDateStamp                    : 2015:08:01
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[IPTC]          DateCreated                     : 2015:08:01
[IPTC]          DigitalCreationDate             : 2015:08:01
[IPTC]          TimeCreated                     : 21:32:08
[IPTC]          DigitalCreationTime             : 21:32:08
[IPTC]          DigitalCreationTime             : 21:32:08
[XMP-xmp]       ModifyDate                      : 2019:04:19 10:48:09+03:00
[XMP-xmp]       CreateDate                      : 2015:08:01 21:32:08.73
[XMP-xmp]       MetadataDate                    : 2019:04:19 10:48:09+03:00
[XMP-photoshop] DateCreated                     : 2015:08:01 21:32:08.73
[XMP-xmpMM]     HistoryWhen                     : 2015:08:09 20:05:43+03:00
[Composite]     SubSecCreateDate                : 2015:08:01 21:32:08.73
[Composite]     SubSecDateTimeOriginal          : 2015:08:01 21:32:08.73
[Composite]     GPSDateTime                     : 2015:08:01 19:31:28.5Z
[Composite]     DateTimeCreated                 : 2015:08:01 21:32:08
[Composite]     DigitalCreationDateTime         : 2015:08:01 21:32:08


Does this fix the time in your images:

exiftool -m -P -overwrite_original_in_place '-GPS:GPSDateStamp<ExifIFD:DateTimeOriginal' '-GPS:GPSTimeStamp<ExifIFD:DateTimeOriginal' 2015-0801-2132-08.jpg
Warning: IPTCDigest is not current. XMP may be out of sync - 2015-0801-2132-08.jpg
    1 image files updated

exiftool -a -G1 -s -time:all 2015-0801-2132-08.jpg                                                                                                         
[System]        FileModifyDate                  : 2015:08:01 21:32:08+03:00
[System]        FileAccessDate                  : 2022:06:15 11:37:43+03:00
[System]        FileInodeChangeDate             : 2022:06:15 11:37:42+03:00
[IFD0]          ModifyDate                      : 2015:08:09 20:05:43
[ExifIFD]       DateTimeOriginal                : 2015:08:01 21:32:08
[ExifIFD]       CreateDate                      : 2015:08:01 21:32:08
[ExifIFD]       SubSecTimeOriginal              : 73
[ExifIFD]       SubSecTimeDigitized             : 73
[GPS]           GPSTimeStamp                    : 21:32:08
[GPS]           GPSDateStamp                    : 2015:08:01
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[IPTC]          DateCreated                     : 2015:08:01
[IPTC]          DigitalCreationDate             : 2015:08:01
[IPTC]          TimeCreated                     : 21:32:08
[IPTC]          DigitalCreationTime             : 21:32:08
[IPTC]          DigitalCreationTime             : 21:32:08
[XMP-xmp]       ModifyDate                      : 2019:04:19 10:48:09+03:00
[XMP-xmp]       CreateDate                      : 2015:08:01 21:32:08.73
[XMP-xmp]       MetadataDate                    : 2019:04:19 10:48:09+03:00
[XMP-photoshop] DateCreated                     : 2015:08:01 21:32:08.73
[XMP-xmpMM]     HistoryWhen                     : 2015:08:09 20:05:43+03:00
[Composite]     SubSecCreateDate                : 2015:08:01 21:32:08.73
[Composite]     SubSecDateTimeOriginal          : 2015:08:01 21:32:08.73
[Composite]     GPSDateTime                     : 2015:08:01 21:32:08Z
[Composite]     DateTimeCreated                 : 2015:08:01 21:32:08
[Composite]     DigitalCreationDateTime         : 2015:08:01 21:32:08


- Matti
Title: Re: GPS Date and Time incorrect
Post by: StarGeek on June 15, 2022, 11:19:53 AM
Quote from: wywh on June 15, 2022, 04:45:19 AM
Does this fix the time in your images:

exiftool -m -P -overwrite_original_in_place '-GPS:GPSDateStamp<ExifIFD:DateTimeOriginal' '-GPS:GPSTimeStamp<ExifIFD:DateTimeOriginal' 2015-0801-2132-08.jpg
Warning: IPTCDigest is not current. XMP may be out of sync - 2015-0801-2132-08.jpg
    1 image files updated

The problem with this is that it is copying the DateTimeOriginal directly into the GPS tags without accounting for the time zone.  And GPS time stamps are supposed to be in UTC, not local time.

The reason I asked for the time listing was to see if it was a time zone issue, since his phone includes the time zone.  Setting aside the 21 second difference, if the photo was taken in a +08:00 time zone, then the date, hour, and minute would be correct. If that is the case, the output should be like this, again, setting aside the second difference
C:\>exiftool -time:all --system:all -G1 -a -s y:\!temp\Test4.jpg
[ExifIFD]       DateTimeOriginal                : 2022:06:15 07:12:59
[GPS]           GPSTimeStamp                    : 23:12:59
[GPS]           GPSDateStamp                    : 2022:06:14
[Composite]     GPSDateTime                     : 2022:06:14 23:12:59Z

Title: Re: GPS Date and Time incorrect
Post by: wywh on June 16, 2022, 03:09:52 AM
Quote from: StarGeek on June 15, 2022, 11:19:53 AM
GPS time stamps are supposed to be in UTC, not local time.

Thanks for reminding me about that.

...hmm it seems iOS 15.5 devices don't have GPSTimeStamp anymore?

exiftool -a -G1 -s -time:all IMG_1079.JPG
[System]        FileModifyDate                  : 2022:06:16 09:33:11+03:00
[System]        FileAccessDate                  : 2022:06:16 09:34:33+03:00
[System]        FileInodeChangeDate             : 2022:06:16 09:34:31+03:00
[IFD0]          ModifyDate                      : 2022:06:16 09:33:11
[ExifIFD]       DateTimeOriginal                : 2022:06:16 09:33:11
[ExifIFD]       CreateDate                      : 2022:06:16 09:33:11
[ExifIFD]       OffsetTime                      : +03:00
[ExifIFD]       OffsetTimeOriginal              : +03:00
[ExifIFD]       OffsetTimeDigitized             : +03:00
[ExifIFD]       SubSecTimeOriginal              : 440
[ExifIFD]       SubSecTimeDigitized             : 440
[GPS]           GPSDateStamp                    : 2022:06:16
[XMP-xmp]       CreateDate                      : 2022:06:16 09:33:11
[XMP-xmp]       ModifyDate                      : 2022:06:16 09:33:11
[XMP-photoshop] DateCreated                     : 2022:06:16 09:33:11
[ICC-header]    ProfileDateTime                 : 2022:01:01 00:00:00
[Composite]     SubSecCreateDate                : 2022:06:16 09:33:11.440+03:00
[Composite]     SubSecDateTimeOriginal          : 2022:06:16 09:33:11.440+03:00
[Composite]     SubSecModifyDate                : 2022:06:16 09:33:11+03:00


- Matti
Title: Re: GPS Date and Time incorrect
Post by: StarGeek on June 16, 2022, 12:53:20 PM
That is really weird.

But luckily the EXIF time zones are there.  So it can be fixed with
exiftool "-GPS*Stamp<SubSecDateTimeOriginal" /path/to/files/
Title: Re: GPS Date and Time incorrect
Post by: wywh on June 19, 2022, 05:44:57 AM
Quote from: StarGeek on June 16, 2022, 12:53:20 PM
But luckily the EXIF time zones are there.  So it can be fixed with
exiftool "-GPS*Stamp<SubSecDateTimeOriginal" /path/to/files/

Thanks, I keep that in mind if GPSTimeStamp is needed somewhere.

It seems that in iOS if there is no GPSTimeStamp, then there is ExifIFD:OffsetTime* (and some images have only OffsetTime, maybe because GPS datetime was unavailable or its metadata was wiped out later):

exiftool -a -G1 -s -fileOrder FileName '-GPS:GPS*Stamp' '-ExifIFD:OffsetTime*' .
======== ./2019-0310-1845-48.jpg
[GPS]           GPSTimeStamp                    : 16:45:47.97
[GPS]           GPSDateStamp                    : 2019:03:10
======== ./2019-1229-2143-32.jpg
[GPS]           GPSDateStamp                    : 2019:12:29
[ExifIFD]       OffsetTime                      : +02:00
[ExifIFD]       OffsetTimeOriginal              : +02:00
[ExifIFD]       OffsetTimeDigitized             : +02:00
======== ./2020-0226-1510-00.jpg
[ExifIFD]       OffsetTime                      : +02:00
[ExifIFD]       OffsetTimeOriginal              : +02:00
[ExifIFD]       OffsetTimeDigitized             : +02:00


I don't exactly know in which iOS version this change has happened because, unlike iOS movies, the images do not seem to have iOS version in metadata.

exiftool -a -G1 -s 2022-0612-1923-17.mov
[...]
[Keys]          Software                        : 15.5


- Matti