How to convert date tags to UTC for renaming purposes

Started by fotoschubser, September 10, 2018, 04:59:31 AM

Previous topic - Next topic

fotoschubser

Hi,

I found a lot of solutions for shifting dates by +/- n hours.

But unfortunately I have a bunch of photos with different time zones. So I do not have a static "n" value.

e.g.

Photo1 - Creation Date: 2018:09:08 15:21:46+02:00
Photo2 - Creation Date: 2018:09:07 17:11:16+04:00


When I use the following command:
exiftool -d %Y%m%d_%H%M%S "-testname<${CreationDate}" -r PHOTODIR

It just truncates the time zone information and gives the following result:

Photo1 --> 20180908_152146
Photo2 --> 20180907_171116

How can i achieve, that the date is internally converted to UTC first, before it is used for renaming?
My expected output would be:

Photo1 --> 20180908_132146
Photo2 --> 20180907_131116

Best regards
fotoschubser

StarGeek

#1
By default, CreateDate returns EXIF:CreateDate, which doesn't contain a time zone component. You would have to specify XMP:CreateDate to get the time zone, if it was included.

You don't mention what system you're on.  If you're on Mac/Linux, take a look at this thread where Phil created the -api timezone option.  Unfortunately, it won't work on Windows.

A work around might be to copy XMP:CreateDate (if it includes the time zone) to GPSDateStamp and GPSTimeStamp.  Exiftool will correct for time zone for that tag.  Then you could use the composite tag, GPSDateTime.
* 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).