Time Wiz: Function to only set time zone without changing timestamp

Started by WebEngel, August 02, 2020, 10:11:28 PM

Previous topic - Next topic

WebEngel

Use case: File has wrong time zone (including no time zone at all) but correct timestamp.

To-be behavior: Use Time Wiz to only change the time zone but keep the timestamp.

As-is: This can be done but is unnecessarily complex.  You could run it twice and add and then subtract one second.  Or you could copy the timestamp from the same metadata tag.  If I am missing a simple option, let me know.

Possible implementation: Allow to enter all zeroes in "Shift Date and Time".  Or add a third option "same" in addition to "subtract" and "add".  Or add a completely new option "keep existing timestamp" (which then should generate a warning if "change time zone" is disabled at the same time).





Mario

You can use a variable for that I suppose.
Use the variable as the source, remove the TZO and set your own as needed. Easy.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mastodon

Is is possible to set Timezone by the GPS coordinates AND date-time data automatically?

Mario

Not so easy.
I guess this would require a lookup to a (usually fee-based) web service which provides time-zone data for GPS coordinates. Or, if such a thing is available, to a local database which provides this information.

See https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates for a related discussion.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Regarding the variable approach:

Assuming a file has a date subject created of

2015:06:13 07:00:15+02:00

the variable:

{File.MD.XMP::photoshop\DateCreated\DateCreated\0|value:rawfrm;substr:0,19}

returns the date and time in the format required by TimeWiz/ExifTool, but strips the time-zone offset (TZO):

2015:06:13 07:00:15

Note the use of rawfrm to get the native date and time from the metadata (not the localized time) and the use of substr to extract the part of the timestamp we're interested in (sans the time zone offset).

If you want to add another time-zone offset instead of the 02:00 you can do so by just appending it to the variable.
For example, to change the TZO from 02:00 to 01:00, use

{File.MD.XMP::photoshop\DateCreated\DateCreated\0|value:rawfrm;substr:0,19}+01:00
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

Mario: May I suggest that these your instructions be also posted in the Tips and Tricks board.


Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook