Copying date gives unexpected result

Started by rienvanham, December 12, 2023, 01:23:26 PM

Previous topic - Next topic

rienvanham

Hi Mario,

I have a lot of photo's where "Create Date" and "Date Subject Created" are different. I tried so align these values by making a Metadata Template with:
Tags:
XMP::photoshop\DateCreated

Fill the tag from this data:
{File.MD.XMP::xmp\CreateDate\CreateDate\0}

This is the value of Create Date:
1980:01:01 00:00:35+02:00

This is the result of running the template:
31:12:1979 23:00:35

Am I doing something wrong? Or: is there a way to copy the value literaly?

Thanks in advance,

Rien.

Mario

If you copy date values, make sure you format them as ExifTool (and IMatch) expect them.
If you don't use format, variables return date and time information formatted based on your locale settings in Windows!

See Note: Date and Time Format in the Variables help topic which covers exactly this case. 

This is also mentioned in the Metadata Templates help topic: Use the Correct Format
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rienvanham

Hi Mario,

Many thanks again! I found that adding "|value:formatted" works best.

Rien.

Mario

This returns the formatted value as delivered by ExifTool.
If you have changed the value in IMatch, the formatted value might differ from the RAW value when the tag is a numerical value until the data has been written, which makes ExifTool to recreate the formatted value.

It might not make a difference here, but keep that in mind.
Which is why all examples in the help use the format function to produce the correct date and time format explicitly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook