I'm trying to extract multiple date/time metadata strings from a bunch of files in order to test how my own code can cope with fields using formats that are not strictly valid.
I read and have tried to follow FAQ 5 (https://exiftool.org/faq.html#Q5).
I'm trying to use
exiftool -T -n -filename -XMP:DateTimeOriginal -XMP:CreateDate# -XMP:DateCreated -XMP:GPSTimeStamp -FileCreateDate -exifIFD:CreateDate -exifIFD:DateTimeOriginal -IFD0:ModifyDate -api strictdate=0 000107.jpg > dates.csv
I know this sample file has CreateDate set using the correct XMP format, with a 'T' in the middle: "2005-05-09T16:01:42-05:00", but even with the -n option, and with a '#' at the end of the CreateDate tag, it's being converted to the standard ExifTool export format, with a space in the middle: "2005:05:09 16:01:42-05:00".
I wondered if it might be an interaction with -T, but it's not.
I'm on Windows 11, using ExifTool.exe 12.92
Any ideas what I'm doing wrong?
I believe the only way to retrieve the exact data would be to use the -v (-verbose) option (https://exiftool.org/exiftool_pod.html#v-NUM--verbose) and parse the output from that. Or create your own version of the tag that extracts the raw data without reformatting.
Interesting, thanks. Yes, that would work. I hadn't seen the -v option used like that before. I'm processing 309000 JPEG files (from the online file corpus collection), but a quick calculation shows that the output stream should only be around 600MB, so I should (hope!) be able to handle that. I may have to leave my parser running overnight for it, though!
Yes, this worked. My code can now consume all date formats that were in the 300000 JPEG files I tested, where I was confident I could parse them correctly.
Having seen some of the crud that developers were putting into date fields, I am now even more impressed by Phil Harvey's stamina, stubbornness and patience in dealing with it!
:)