Date / time

Started by Sanje, September 17, 2022, 12:08:17 PM

Previous topic - Next topic

Sanje

Hi ! I am using exif tool to name photos and want to insert the original date of creation of the photo but dont want the time. If there is a way to do that please advise. Many Thanks

wywh

How do you want to treat images taken on the same date? Try something like:

exiftool -fileOrder FileName '-FileName<DateTimeOriginal' -d '%Y-%m%d%%lc.%%e' .
I prefer seconds:

exiftool -fileOrder FileName '-FileName<DateTimeOriginal' -d '%Y-%m%d-%H%M-%S%%lc.%%e' .
- Matti

Sanje

Thanks. I am using the original number sequence from the shoot.For example the original name was abc_1950. The images were 1950, 51, 52 etc.. I dont want the time and only the date because it makes the name too long

Sanje

Images from the same date have unique sequential numbers. The time of the shot is redundant. How do I extract just the date?

StarGeek

You use the -d (-dateFormat) option similar to wywh's first command.  See Common Date Format Codes.  For details on %f/%e see the -w (-TextOut) option.

To keep part of the original name, you would have to either add %%f to the date format string or add %f to the tag copy part and add a dollar sign before DateTimeOriginal

exiftool '-FileName<DateTimeOriginal' -d '%%f %Y-%m%d.%%e' /path/to/files/
or
exiftool '-FileName<%f $DateTimeOriginal.%e' -d '%Y-%m%d' /path/to/files/

You give an example of how your files are currently named, but not how you want them to end up.  I just added the a space and then the date in the above commands.

The above commands use single quotes and will work on Linux/Mac/Powershell.  If you're using Windows CMD, change the single quotes into double quotes.
"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