Setting "Year" tag from "CreateDate" tag but maintaining Year's YYYY format?

Started by Athelstan, November 08, 2023, 10:37:39 AM

Previous topic - Next topic

Athelstan

On a collection of my mp4 videos, I want to yet the currently empty "Year" tag to the year they were taken. I want the "Year" tag to be in the YYYY format (e.g. 2014) and not include any other time info (month, day, hours etc.).

I tried the following command

exiftool -year<CreateDate C:\sample.mp4

but this gives me a "Year" tag value of "2014:04:03: 15:21::08", when I want just "2014"

Is there a way to extract the just year from the CreateDate tag and input it into "Year" field?

I have searched the forums and the internet in general but failed to find one.

StarGeek

#1
Use the -d (-dateFormat) option.

exiftool -d %Y "-year<CreateDate" C:\sample.mp4


See Common Date Format Codes for the % variables you can use.

Edit: Forgot the quotes in the tag copy part of the command.
"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