Hello everyone!
I have thousands of photos and videos whose file name makes the date of the file explicit, but in the metadata the date is not present.
The format of my file names is "IMG-20220102-WA0050.jpg".
So, I used the regular expression
exiftool -overwrite_original -DateTimeOriginal='${Filename:0:4}-${Filename:5:2}-${Filename:8:2}' *.jpg
But i receive this "Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv)
Nothing to do."
I am new in this world, so I am sorry if I am asking you something really stupid, may someone help me?
Thank you :D
Try something like this:
exiftool '-DateTimeOriginal<${filename;s/IMG-(\d\d\d\d)(\d\d)(\d\d)-.*$/$1-$2-$3/}' -d '%Y-%m-%d' -ext jpg .
You might need to switch single quotes to double quotes under Windows
It worked, thank you so much!!! ;D ;D ;D
Previous post (https://exiftool.org/forum/index.php?topic=14262.msg77199#msg77199) for dealing with What's App images.
Thank you so much!
What about if I want to do the same with videos with the same template? (VID-20200407-WA0065.mp4)
Same command would work, except you would probably want to add the -api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC), as video time stamps are supposed to be in UTC.
See this post (https://exiftool.org/forum/index.php?topic=15650.msg84143#msg84143) for my standard copy/paste on videos and UTC.