photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: rienvanham on December 12, 2023, 01:23:26 PM

Title: Copying date gives unexpected result
Post by: rienvanham on December 12, 2023, 01:23:26 PM
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.
Title: Re: Copying date gives unexpected result
Post by: Mario on December 12, 2023, 02:02:09 PM
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 (https://www.photools.com/help/imatch/var_basics.htm?dl=hid-44) in the Variables help topic which covers exactly this case. 

This is also mentioned in the Metadata Templates help topic: Use the Correct Format (https://www.photools.com/help/imatch/md_templates.htm?dl=hid-17)
Title: Re: Copying date gives unexpected result
Post by: rienvanham on December 12, 2023, 02:48:20 PM
Hi Mario,

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

Rien.
Title: Re: Copying date gives unexpected result
Post by: Mario on December 12, 2023, 02:55:35 PM
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.