News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Setting FileModifyDate from DateTimeOriginal ignores time zone

Started by Archive, May 12, 2010, 08:54:29 AM

Previous topic - Next topic

Archive

[Originally posted by dtgriscom on 2009-01-07 15:28:17-08]

I have a pile of images that were taken in time zone GMT, but I'm currently in EST. I'd like to set the file modification date based on the DateTimeOriginal field. The obvious answer is to use '-DateTimeOriginal>FileModifyDate', but that assumes that DateTimeOriginal is specified in the current time zone, so everything gets shifted by five hours.

Is there a way to tell exiftool which time zone a file's timestamps should be interpreted in? Normally this doesn't matter because exif tags don't know about timezones, but file modification dates do.

Thanks,

Dan

Archive

[Originally posted by exiftool on 2009-01-07 15:45:43-08]

Interesting dilemma.  I suggest a 2-step process:

Code:
exiftool '-DateTimeOriginal>fileModifyDate' FILE
 exiftool -fileModifyDate-=5

Alternatively, you could set your system timezone to GMT before
setting the filemodifydate, then change it back again afterwards.

- Phil

Archive

[Originally posted by dtgriscom on 2009-01-07 16:01:22-08]

Good workaround.

May I suggest adding a new feature that addresses this? Something like

-timezone GMT

which would interpret all non-time-zoned times as being in EST. (Actually, it would probably work by being ignored for everything except for FileModifyDate, where it would be used to calculate an offset.)

Thanks,

Dan

Archive

[Originally posted by exiftool on 2009-01-07 16:19:53-08]

Hi Dan,

Wait.  I just thought of something!  ExifTool is too smart for
me sometimes.  You can also do this sort of thing:

Code:
exiftool '-fileModifyDate<$dateTimeOriginal+00:00' FILE

Brilliant!

No need for a new option.

- Phil

Archive

[Originally posted by exiftool on 2009-01-07 17:05:50-08]

I should mention that braces would be needed around
"dateTimeOriginal" if the value was negative (since a
dash is a valid character in a tag name), just in case
someone out there tries to do this for pictures in a western
time zone, ie)

Code:
exiftool '-fileModifyDate<${dateTimeOriginal}-08:00' FILE

And Windows users must use double quotes, not single quotes.

- Phil