Trying to set every date to the date at which a photo was taken

Started by bl4ze, August 04, 2023, 06:31:59 PM

Previous topic - Next topic

bl4ze

I tried
exiftool "-AllDates<DateTimeOriginal" <image_file>
and it returns 1 image files updated but the values stay the same when checking up on them again, I specifically want the CreationDate to be set to the Date at which the photo was taken but I would like best to have all dates set to it.

StarGeek

See the notes under AllDates on the  Shortcuts tags page

AllDates is a shortcut only to the three most common EXIF timestamps, CreateDate, DateTimeOriginal, and ModifyDate.  It does not edit any other tag.

To write CreationDate, you would use
exiftool "-CreationDate<DateTimeOriginal" /path/to/files/

There is Time:all, but you almost never want to write to that, as it will write to about 90 tags in total in an image file, many of which will not be applicable.

A more targeted approach would use the -wm (-writeMode) option, specifically -wm cg.  This command would update all date/time tags that already exist in the file, but it will not create any new ones
exiftool -wm cg "-Time:All<DateTimeOriginal" /path/to/files/
"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

bl4ze

Thank you so much for your help!
However, I tried using
exiftool "-CreationDate<DateTimeOriginal" /path/to/files/which again in return gave me 1 image files updated but it didn't actually change the date created on the file that I changed. Then I tried using
exiftool -wm cg "-Time:All<DateTimeOriginal" /path/to/files/But all that did is returning
0 image files updated
1 image files unchanged
without any error whatsoever. What am I doing wrong?

Phil Harvey

The problem is usually that you are writing the wrong date/time tag.

Quote from: bl4ze on August 05, 2023, 06:41:20 AMbut it didn't actually change the date created on the file that I changed.

ExifTool did change the date if it said the file was updated.  Why do you say it didn't change?

Use this command to see all date/time tags in the file:

exiftool -a -G1 -s FILE

And be sure you are writing the correct one.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).