ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Mac2 on November 10, 2017, 08:17:27 AM

Title: DateTIme Formats always formatted as YYYY:MM:DD HH:MM:SS?
Post by: Mac2 on November 10, 2017, 08:17:27 AM
I thought ExifTool would always format EXIF/XMP timestamps (Original/Created/Modified) as YYYY:MM:DD HH:MM:SS (and maybe the optional time-zone offset).

I just noticed for a file created with On1 Photo RAW, -alldates returns:

[ExifIFD]       Date/Time Original              : 2017:08:17 9:33:26
[ExifIFD]       Modify Date                     : 2017:08:17 9:33:26


Note the missing leading 0 in front of the hour. Is this correctly formatted?
I've searched my database with thousands of tag values imported from ExifTool and it always shows single digit hours with a leading 0.

Title: Re: DateTIme Formats always formatted as YYYY:MM:DD HH:MM:SS?
Post by: Phil Harvey on November 10, 2017, 10:41:02 AM
By default, exiftool doesn't reformat EXIF date/time values.  But you can do it with the -d option:

exiftool -d "%Y:%m:%d %H:%M:%S" ...

- Phil
Title: Re: DateTIme Formats always formatted as YYYY:MM:DD HH:MM:SS?
Post by: Mac2 on November 10, 2017, 12:13:57 PM
Thanks. I will enhance my XML parser.
Title: Re: DateTIme Formats always formatted as YYYY:MM:DD HH:MM:SS?
Post by: StarGeek on November 10, 2017, 04:10:08 PM
I've encountered a few files over the years that had incorrectly written EXIF timestamps.  I've seen them written as MM/DD/YYYY and MM-DD-YYYY, though I don't recall too many with errors in the time part.
Title: Re: DateTIme Formats always formatted as YYYY:MM:DD HH:MM:SS?
Post by: Mac2 on November 11, 2017, 07:13:17 AM
It's rare. I searched my database and in over 60,000 records I have only two timestamps without a leading 0 for the hour. I will enhance my XML parser to deal with that so I get clean data.