Timezone offset dropped when setting date

Started by ted_shaffer, August 08, 2024, 04:21:46 PM

Previous topic - Next topic

ted_shaffer

exiftool foo.jpg
>> output shows no entries for Create Date, Date/Time Original, or Modify Date.
exiftool -AllDates="2024:07:16 09:43:54.562-07:00" foo.jpg
exiftool foo.jpg | grep Date
>> output for relevant date values
Modify Date                     : 2024:07:16 09:43:54
Date/Time Original              : 2024:07:16 09:43:54
Create Date                     : 2024:07:16 09:43:54

I expected to see the -07:00 in the dates.
Am I misunderstanding or did I do something wrong or is there a workaround?


StarGeek

You are misunderstanding the underlying tags. The EXIF date/time tags only hold the date and time. They do not hold the time zone or the subseconds. Those are held in separate tags.

The AllDates shortcut will write to the three most common EXIF timestamps, CreateDate, DateTimeOriginal, and ModifyDate. For each of these, there is a matching time zone tag, OffsetTimeDigitized, OffsetTimeOriginal, and OffsetTime respectively, and a matching subsecond tag, SubSecTimeDigitized, SubSecTimeOriginal, and SubSecTime.

Luckily, exiftool provides some shortcuts to write all three matching tags at once (see the Composite tags page), though not one that will write to all nine at once.

Using the shortcuts, your command would be
exiftool -SubSecTimeDigitized="2024:07:16 09:43:54.562-07:00" -SubSecTimeOriginal="2024:07:16 09:43:54.562-07:00" -SubSecModifyDate="2024:07:16 09:43:54.562-07:00" /path/to/files/


"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