Not saving timezone with file

Started by OvalPiston, November 21, 2023, 04:12:50 PM

Previous topic - Next topic

OvalPiston

When I run this on the original asdf.jpg file exiftool "asdf.jpg" -CreateDate, it gives this result:

Create Date                     : 2010:10:31 08:58:38-04:00


But if I try and set it manually: exiftool "asdf.jpg" -CreateDate="2010:10:31 08:58:38-04:00" -overwrite_original_in_place
It gives this result:

Create Date                     : 2010:10:31 08:58:36


My question is why is the time zone I am putting into place not being kept?

StarGeek

Because the EXIF:CreateDate (and EXIF:DateTimeOriginal/EXIF:ModifyDate) cannot hold a time zone.

EXIF time stamps are split across three separate tags.  There's the main tags, mentioned above, there's the OffsetTime tags (OffsetTimeDigitized/OffsetTimeOriginal/OffsetTime respectively), and the SubSecond tags (SubSecTimeDigitized/SubSecTimeOriginal/SubSecTime).  Each tag needs to be filled to have the full time stamp.

Exiftool does give a shortcut for each of these groups, so you can write all three at once.
>exiftool -P -overwrite_original -SubSecCreateDate="2023:11:21 12:00:00.55-08:00" -SubSecDateTimeOriginal="2023:11:21 12:00:00.55-08:00" -SubSecModifyDate="2023:11:21 12:00:00.55-08:00" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -time:all --system:all -G1 -a -s y:\!temp\Test4.jpg
[IFD0]          ModifyDate                      : 2023:11:21 12:00:00
[ExifIFD]       DateTimeOriginal                : 2023:11:21 12:00:00
[ExifIFD]       CreateDate                      : 2023:11:21 12:00:00
[ExifIFD]       OffsetTime                      : -08:00
[ExifIFD]       OffsetTimeOriginal              : -08:00
[ExifIFD]       OffsetTimeDigitized             : -08:00
[ExifIFD]       SubSecTime                      : 55
[ExifIFD]       SubSecTimeOriginal              : 55
[ExifIFD]       SubSecTimeDigitized             : 55
[Composite]     SubSecCreateDate                : 2023:11:21 12:00:00.55-08:00
[Composite]     SubSecDateTimeOriginal          : 2023:11:21 12:00:00.55-08:00
[Composite]     SubSecModifyDate                : 2023:11:21 12:00:00.55-08:00

Also note that this doesn't apply to XMP tags, like you would find in an XMP sidecar file.  XMP time stamps can hold the entire date/time/subsec/timezone in a single tag.  In this example I use the AllDates shortcut to write all three  at once.
C:\>exiftool -P -overwrite_original -XMP:AllDates="2023:11:21 12:00:00.55-08:00" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -time:all --system:all -G1 -a -s y:\!temp\Test4.jpg
[XMP-exif]      DateTimeOriginal                : 2023:11:21 12:00:00.55-08:00
[XMP-xmp]       CreateDate                      : 2023:11:21 12:00:00.55-08:00
[XMP-xmp]       ModifyDate                      : 2023:11:21 12:00:00.55-08:00

Also see FAQ #5.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype