Adding/Modifying timezones

Started by markseger, January 05, 2022, 04:13:55 PM

Previous topic - Next topic

markseger

I'm running exiftool on my Windows 10 box and I found several posts on timezones but not quite what I'm looking for.

Like many, I've been struggling with google photos and have figured out if the date/time of the photo taken in conjunction with the TimeZone are correct, the pictures will be loaded/displayed in the right order. The bulk of my photos are taken with a Nikon but I also want to include photos taken by others, some which have not been set to record the correct timestamps and in some cases don't even include the timezone.

When there is a timezone present, I can easily change it with exiftool this:

exiftool.exe -TimeZone=+2:00 _DSC2733.jpg

and it correctly sets the timezone to +2:00 as expected.

However if I have a file with no timezone present, i can't figure out the syntax to set it:

exiftool.exe -TimeZone=+2:00 _DSC2745_pps.jpg
    0 image files updated
    1 image files unchanged

I did discover I can alternatively specify TimeZoneOffset but it doesn't like minutes specified:

C:\photos-travel\2021\Iceland\Borgarnes>\mjs\photos\exiftool.exe -TimeZoneOffset=+2:00 _DSC2745_pps.jpg
Warning: Not an integer for ExifIFD:TimeZoneOffset
Nothing to do.

and if I leave the minutes off like this it does work, sort of:

exiftool.exe -TimeZoneOffset=+2 _DSC2745_pps.jpg
    1 image files updated

exiftool.exe _DSC2745_pps.jpg | find "Zone"
Time Zone Offset                : 2

but if I load that image info Google Photos it tells me the timezone is 0.

I'm guessing I'm doing something silly but I've been playing around with alternate syntaxes quite awhile and nothing seems to work.

-mark

StarGeek

Quote from: markseger on January 05, 2022, 04:13:55 PM
However if I have a file with no timezone present, i can't figure out the syntax to set it:

exiftool.exe -TimeZone=+2:00 _DSC2745_pps.jpg
    0 image files updated
    1 image files unchanged

This would be FAQ #3.  If you run that command, you will see that TimeZone is a Nikon specific MakerNotes tag.  And MakerNotes "may be edited but not created or deleted individually" (see Note #2 under the -TAG[+-^]=[VALUE] option).

QuoteI did discover I can alternatively specify TimeZoneOffset but it doesn't like minutes specified:

TimeZoneOffset is a non-standard tag that was made before the EXIF standard actually added time zone tags.  There are three time zone tags, EXIF:OffsetTimeOriginal, EXIF:OffsetTime, and EXIF:OffsetTimeDigitized, which correspond to EXIF:DateTimeOriginal, EXIF:ModifyDate, and EXIF:CreateDate respectively.  You can set all three at once with a command like
-EXIF:OffsetTime*=+02:00

Quotebut if I load that image info Google Photos it tells me the timezone is 0.

It's been a while since I've checked, so I don't know if Google Photos will read the above EXIF time zone tags.  I do have in my notes from Nov 2019 that Google Photos would read the time zone if it was included in an XMP date/time tag such as XMP:DateCreated and XMP:DateTimeOriginal.  But if there were GPS coordinates in the file, Google would figure out the actual time zone at that location at that time and use that, overriding anything else.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

markseger

Thanks for the super-clear explanation. I hadn't realized just how complex all this metadata is and the relationship to the type of image.

That said, I've been going over some of my photos and adding

-EXIF:OffsetTime*=+2:00

and it works great. Now when I load them into google photos the timezone shows as +2 whereas before it was usually 0. However, I still have one more problem and this seems to be with some photos from an iphone (but I'm not sure if it's all photos from an iphone).  Anyhow, I've added in those +2:00 tags but when I then upload the photo to google photos and examine the timestamp they still show up as 0. Might there be other tags needed with iphone images? Wouldn't surprise me at this point.

StarGeek

Quote from: markseger on January 06, 2022, 01:27:35 PM
I hadn't realized just how complex all this metadata is and the relationship to the type of image.

Oh, it really is a hot mess.  It's why I usually suggest using programs such as Bridge, Lightroom, Digikam, that take care of it behind the scenes.

QuoteThat said, I've been going over some of my photos and adding
-EXIF:OffsetTime*=+2:00
and it works great.

Good to know.  I'll keep a note of that for future reference.

QuoteHowever, I still have one more problem and this seems to be with some photos from an iphone (but I'm not sure if it's all photos from an iphone).  Anyhow, I've added in those +2:00 tags but when I then upload the photo to google photos and examine the timestamp they still show up as 0. Might there be other tags needed with iphone images?

Apple really seems to have a problem reading standards :P

Try running this command on one of the files and see if anything stands out.  It will list all the time related tags in the file.
exiftool -Time:All file.jpg
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

markseger

btw - I'm perfectly will to concede the problem may indeed lie with the way google photos deals with time/zones. I have seen a number of older posts but the particular photos in question were literally taken 6 months ago and uploaded in the last couple of days.

Also keep in mind this is a windows platform. If necessary, I do have a powered down linux box I could do a few experiments on if it will help.

I also added -Model to include the camera type in the output


Camera Model Name               : iPhone 8 Plus
File Modification Date/Time     : 2022:01:06 12:22:42-05:00
File Access Date/Time           : 2022:01:07 12:18:07-05:00
File Creation Date/Time         : 2021:08:09 12:53:20-04:00
Modify Date                     : 2021:07:29 17:02:40
Date/Time Original              : 2021:07:29 17:02:40
Create Date                     : 2021:07:29 17:02:40
Offset Time                     : +02:00
Offset Time Original            : +02:00
Offset Time Digitized           : +02:00
Sub Sec Time Original           : 984
Sub Sec Time Digitized          : 984
Digital Creation Time           : 14:59:40+05:00
Digital Creation Date           : 2021:07:29
Date Created                    : 2021:07:29
Time Created                    : 14:59:40+05:00
Profile Date Time               : 2016:01:01 00:00:00
Create Date                     : 2021:07:29 17:02:40.984+02:00
Date/Time Original              : 2021:07:29 17:02:40.984+02:00
Modify Date                     : 2021:07:29 17:02:40+02:00
Date/Time Created               : 2021:07:29 14:59:40+05:00
Digital Creation Date/Time      : 2021:07:29 14:59:40+05:00



Camera Model Name               : NIKON D5600
File Modification Date/Time     : 2021:07:29 13:06:12-04:00
File Access Date/Time           : 2022:01:07 12:18:01-05:00
File Creation Date/Time         : 2021:08:07 13:17:16-04:00
Modify Date                     : 2021:07:29 17:06:11
Date/Time Original              : 2021:07:29 17:06:11
Create Date                     : 2021:07:29 17:06:11
Time Zone                       : +02:00
Daylight Savings                : Yes
Date Display Format             : M/D/Y
Power Up Time                   : 0000:00:00 00:00:00
Sub Sec Time                    : 46
Sub Sec Time Original           : 46
Sub Sec Time Digitized          : 46
Create Date                     : 2021:07:29 17:06:11.46
Date/Time Original              : 2021:07:29 17:06:11.46
Modify Date                     : 2021:07:29 17:06:11.46


I have used exif to examine the photo dates/times using windows explorer - very cool feature. Anyhow

iphone: 7/29/2021 05:02:50 which does correspond to many of the times shown by exif  and also by google photos, but GF does report the timezone as GMT +0. No timezone tag and in fact no tag with "Zone" in it, though clearly there are some "+02:00" appended to some of the times

nikon: 7/29/2021 05:06:11 which GF also reports correctly AND with a timezone of GMT +2. I also do see the timezone tag in the metadata.

Hope all this makes sense. Might there be other tags I could insert to force a timezone?

btw - I used the 'code' tags to make the output easier to read, is there a better way to do this?

StarGeek

Quote from: markseger on January 07, 2022, 12:25:06 PM
btw - I'm perfectly will to concede the problem may indeed lie with the way google photos deals with time/zones.

Nothing in that listing stands out, though I realized I should have given you the command of
exiftool -time:all -G1 -a -s file.jpg
in order to see tags with duplicated names and the locations.

If you're willing to provide a sample image, either here or through a DM on these forums, I can take a closer look but it may just be an idiosyncrasy of either Google or Apple.

Quotebtw - I used the 'code' tags to make the output easier to read, is there a better way to do this?

This is the way.  As it says directly below the box when you post
(Use [tt][/tt] for command line examples, and [code][/code] for sample exiftool output)
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

markseger

Always happy to share.

I found the options to attach a file so here's the JPG. If you care, it's a picture of me eating a piece of rotted shark, some icelanders consider it a delicacy. :)

I suppose an interesting experment, which you probably already thought of is to upload it to google photo and confirm the timezone of 0 I'm seeing it tagged with.