ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: trainman on March 27, 2023, 04:59:46 AM

Title: Can't get sub seconds to work
Post by: trainman on March 27, 2023, 04:59:46 AM
I'm having trouble renaming my files.  I take a lot of Burst photos, and want to use the fractional seconds in the filenames for sorting purposes.

When I run the command
exiftool -d %Y-%m-%d_%H%M-%S-%-3f.%%e "-testname<CreateDate" .
It outputs the fractional seconds as 000, but when I run
exiftool -subsecdatetimeoriginal img12345.heic
It correctly shows the fractional seconds as 462.

Normally I use GeoSetter for renaming my files, but it does not support extracting the EXIF data from HEIC files yet.

Any Idea why the %-3f tag doesnt retrieve the fractional seconds, and what I can do to fix it please?
Title: Re: Can't get sub seconds to work
Post by: greybeard on March 27, 2023, 07:57:54 AM
Maybe use subsecdatetimeoriginal instead of CreateDate if that gives the result you need
Title: Re: Can't get sub seconds to work
Post by: StarGeek on March 27, 2023, 11:35:13 AM
Greybeard has the (almost?) correct answer.  Though if you want to use the subseconds corrisponding to CreateDate, you would use SubSecCreateDate (see the Composite tags page (https://exiftool.org/TagNames/Composite.html)).

CreateDate only includes the the day and time down to the seconds.  Subseconds are held in a completely different tag, SubSecTimeDigitized, so they won't show up when you use just CreateDate.  And timezone is held yet a different tag, OffsetTimeDigitized.

Example:
C:\Programs\My_Stuff>exiftool -time:all --file:all -G1 -a -s y:\!temp\Test4.jpg
[ExifIFD]       CreateDate                      : 2023:03:27 12:00:00
[ExifIFD]       OffsetTimeDigitized             : -07:00
[ExifIFD]       SubSecTimeDigitized             : 55
[Composite]     SubSecCreateDate                : 2023:03:27 12:00:00.55-07:00
Title: Re: Can't get sub seconds to work
Post by: greybeard on March 27, 2023, 01:11:03 PM
Quote from: StarGeek on March 27, 2023, 11:35:13 AMGreybeard has the (almost?) correct answer.

Thanks for adding the much more complete answer