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.
Use the -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat).
exiftool -d %Y "-year<CreateDate" C:\sample.mp4
See Common Date Format Codes (https://exiftool.org/filename.html#codes) for the % variables you can use.
Edit: Forgot the quotes in the tag copy part of the command.
Thanks for the quick reply. Much appreciated. :)