Main Menu

Add SubSeconds to Filename

Started by gnulab, October 22, 2022, 11:20:22 AM

Previous topic - Next topic

gnulab

Hi,

I am trying to rename my JPG files to this format yyyymmdd-hhmmss.SSS.jpg

The example on https://exiftool.org/ gives this

"exiftool(-k).exe" "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR

I modified it to this

"exiftool(-k).exe" "-FileName<CreateDate" -d "%Y%m%d_%H%M%S%3f.%%e" DIR

but it results in 20221016_144137.000.jpg
What is missing?


Thank you.

StarGeek

The EXIF:CreateDate does not include subseconds.  That data (and time zone) are recorded in a separate tag.

You have a couple of choices.  You can either include move the %e from the date format string and include the subseconds tag in your rename
exiftool "-FileName<${CreateDate}.$SubSecTimeDigitized.%e" -d "%Y%m%d_%H%M%S" DIR

Or use the Composite tag that exiftool creates on the fly that includes the subseconds
exiftool "-FileName<SubSecCreateDate" -d "%Y%m%d_%H%M%S%3f.%%e" DIR
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).