Two different date formats on one call

Started by ekkidee, January 07, 2018, 11:24:05 PM

Previous topic - Next topic

ekkidee

Hi, I need to use two different date formats in a call. Example:

exiftool -ext jpg -m -d "%y%m%d-%H%M%S" -overwrite_original_in_place \
   '-UserComment<(c) ekkidee $createDate' \
   '-ImageUniqueID<dateTimeOriginal' \
   '-FileModifyDate<dateTimeOriginal' \
      $arglist

This clip sets a user comment to a copyright string, and establishes a unique ID to a timestamp. It also resets the file's timestamp.

The first occurrence ($createDate) should be four-digit year only: %Y

The second and third occurrences (dateTimeOriginal) are in the form indicated on the command line: %y%m%d-%H%M%S

The command above works fine as given, but the copyright string is wrong. I am wondering if I can somehow force a full four-digit year when $createDate is referenced, or if there is another source for the year. I tried coding two separate -d parms but only the second one was observed. Obviously, two separate command line calls will also work.

Thanks!


StarGeek

For the first one, use the DateFmt feature from Advanced Formatting:
'-UserComment<(c) ekkidee ${createDate#;DateFmt("%Y")}'
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

ekkidee

Ha I was just looking into that. Thanks for your help!

ETA ... works like a charm ... have to say this is a sweet tool.