Express date / time in a different time zone

Started by britsy, October 13, 2022, 04:16:53 PM

Previous topic - Next topic

britsy

Hello,

I'm trying to find the best way to express a time / date in a different time zone. I.e. the date / time is correct but as it was copied from FileModifyDate it has the time zone of my PC instead of where the photo was taken (when taken in a different time zone).

I need to do this for:
- EXIF:DateTimeOriginal (and so for OffsetTimeOriginal)
- EXIF:CreateDate (and so for OffsetTimeDigitized)

--> Here I was thinking doing something like -EXIF:DateTimeOriginal+="6:00" -OffsetTimeOriginal+="6:00"(assuming here I need to express the date in UTC+2 time zone), but it does not work for the offset part. An alternative would be to enter the value of the time zone in "hard" but I was curious to understand if we could increase / decrease it based on the current value instead. Last, I am wondering if there is not an easier way to do it, like a single entry that would shift both values at the same time.

And for:
- XMP:DateCreated
- PNG:CreationTime
- Quicktime:CreationDate

--> I'm a bit lost for these ones as the date contains the time zone as well. I did not manage to make it work.

Thanks a lot in advance!


Phil Harvey

Maybe something like this?:

-EXIF:DateTimeOriginal+="6:00" -OffsetTimeOriginal="+02:00"

But this is the "hard" way as you may have eluded to.  There is no current way to shift the OffsetTimeOriginal tag.  (Maybe I should add this feature.)

To shift the time zone of a date/time tag containing a time zone, do something like this:

-xmp:createdate+=+06:00

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

britsy

Thanks Phil!

Quote from: Phil Harvey on October 13, 2022, 04:31:51 PMMaybe something like this?:

-EXIF:DateTimeOriginal+="6:00" -OffsetTimeOriginal="+02:00"

But this is the "hard" way as you may have eluded to.  There is no current way to shift the OffsetTimeOriginal tag.  (Maybe I should add this feature.)
Yes, that's the "hard" way I figured out.  :) My case being relatively simple, that's fine.

QuoteTo shift the time zone of a date/time tag containing a time zone, do something like this:

-xmp:createdate+=+06:00
This does not work as it "changes" only the time zone, e.g.:
Date was:
CreationTime                    : 2020:05:22 14:26:51-04:00

And is now:
CreationTime                    : 2020:05:22 14:26:51+02:00

But should be:
CreationTime                    : 2020:05:22 20:26:51+02:00

Is there a way to change both the hours and the time zone of this tag?

Thanks!

Phil Harvey

Sorry.  Yes, my example changed only the time zone.  To change both (add 6 hours to the time and the time zone), do this:

-xmp:createdate+=06:00+06:00

The SHIFT STRING section of this page gives all the details of the syntax, with examples.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

The next version of ExifTool (12.49) will support shifting time zones, eg)

-offsettimeoriginal+=+06:00

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

britsy

Many thanks Phil and good to know that time zone shifting is coming soon!  :D