Hi
I have some Exif data like this:
c:\Temp>exiftool -s -G -OffsetTime* -AllDates IMG_xxx.jpg
[EXIF] OffsetTime : +08:00
[EXIF] OffsetTimeOriginal : +08:00
[EXIF] DateTimeOriginal : 2017:09:10 13:50:03
[EXIF] CreateDate : 2017:09:10 13:50:03
[EXIF] ModifyDate : 2017:10:03 00:36:06
I like to set all times to UTC time. Doing this manually is not problem with
exiftool -OffsetTime*=+00:00 -AllDates-=8 IMG_xxx.jpg
Now I like to do it dynamically based on "OffsetTimeOriginal". I tried several commands, e.g.
exiftool "-AllDates<${DateTimeOriginal}-${OffsetTimeOriginal}" -OffsetTime*=+00:00 IMG_xxx.jpg
but times are not changed.
Any idea how to achieve this?
I think this may do what you want:
exiftool "-exif:AllDates-<${OffsetTimeOriginal;s/^\+// or $_=undef}" "-exif:AllDates+<${OffsetTimeOriginal;s/^\-// or $_=undef}" "-offsettime*=+00:00" FILE
The command is complicated a bit so it will handle both positive and negative time zones. Also, I am only changing EXIF dates because XMP dates should have their own time zones.
- Phil
It's working, thank you.