Hi,
First of all thank you for providing an amazing tool - it has been invaluable for us for over a decade!
Our use case (of DAM) is mainly for machine use so we always have the "-n" option enabled so e.g. duration and filesize fields get returned so they are easy to parse.
However, we would also like the datetime fields reformatted at the same time because the default "YYYY:MM:DD HH:MM:SS" format aren't recognised by the languages we now use (Python and Java).
The dateformat option works fine on it's own like e.g. so:
exiftool -d "%Y-%m-%d %H:%M:%S" "filepath"
but the -n parameter seems to "overrule" the -d option and both of these result in the default dates:
exiftool -n -d "%Y-%m-%d %H:%M:%S" "filepath"
exiftool -d "%Y-%m-%d %H:%M:%S" -n "filepath"
I believe it's possible to target specific field names but we would like to reformat all date fields whatever they may be, and this is of course like the wild west because different files can have wildly different names and amount of date fields in.
Can we have our cake and eat it directly in Exiftool so we don't have to manually loop over all fields after extraction and reformat the date ones?
I don't believe so, but Phil will have to verify.
The whole point of the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) is to disable any conversions of the extracted data.
Thanks StarGeek!
Perhaps in the future it might be worth considering changing the default returned datetime format to e.g. an ISO format (https://en.wikipedia.org/wiki/ISO_8601) as I don't believe the current default is recognised as a valid datetime format by many of the mainstream programming languages, although I guess it is in Perl which I think Exiftool is based on.
I appreciate that this would be a pretty disruptive change so not to be taken lightly : )
Quote from: jenslundgaard on December 21, 2020, 10:34:19 AM
I don't believe the current default is recognised as a valid datetime format by many of the mainstream programming languages, although I guess it is in Perl which I think Exiftool is based on.
The default format is the EXIF standard. Perl has no preferred built-in date/time format.
QuoteI appreciate that this would be a pretty disruptive change so not to be taken lightly : )
Yes. I would never implement a disruptive change like this.
I can't think of a way to do what you want in ExifTool. The option I think would be to post-process the output to reformat the date/time values for your purposes.
- Phil
Ok, thanks for the confirmation.
We will format the dates as a post-process job - and thanks again for a great tool!