ExifTool Forum

ExifTool => Newbies => Topic started by: Sylvain M. on May 01, 2020, 05:11:33 PM

Title: Export DateTimeOriginal
Post by: Sylvain M. on May 01, 2020, 05:11:33 PM
Related to this topic (https://exiftool.org/forum/index.php?topic=11087.0), I would like to export the creation date (DateTimeOriginal) of my photos in a unique format.
Here is my current request :
exiftool -T -r -Directory -filename -DateTimeOriginal -model -GPSLatitude# -GPSLongitude# -ext jpg -charset FileName=Latin "M:\Photos" > "M:\Photos\dbphotos.txt"
The problem is that I have dates in different formats.
Is there an option to have all dates in the same format?
For example YYYY:MM:DD hh:mm:ss

Thank you in advance !
Title: Re: Export DateTimeOriginal
Post by: StarGeek on May 01, 2020, 05:15:33 PM
YYYY:MM:DD hh:mm:ss is the format that the DateTimeOriginal tag is supposed to be in according to the spec.  If you have DateTimeOriginal tags in a different format, then it's written incorrectly.  What format is the problematic files in?
Title: Re: Export DateTimeOriginal
Post by: Sylvain M. on May 01, 2020, 05:18:57 PM
Some dates are like this : 2015:02:15 17:07:13+00:00 others like this : 2015:04:19 12:43:
But I may have just figured it out, with this : -DateTimeOriginal#
I will try  !
Title: Re: Export DateTimeOriginal
Post by: Sylvain M. on May 01, 2020, 05:23:15 PM
QuoteI will try  !
Unfortunately, no... It's not working  :'(
Title: Re: Export DateTimeOriginal
Post by: StarGeek on May 01, 2020, 05:32:38 PM
Ah, so it has a time zone added on.  Odds are that exiftool is displaying the XMP:DateTimeOriginal tag.  First, I'd suggest specifying that you want the EXIF tag, e.g. EXIF:DateTimeOriginal instead of just DateTimeOriginal.

The other option would be to use the -d (dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) and add
-d "%Y:%m:%d %H:%M:%S"
This should work either way.
Title: Re: Export DateTimeOriginal
Post by: Sylvain M. on May 02, 2020, 09:41:41 AM
Thank you very much, Stargeek  :D
I had better results with the 2nd option because the EXIF filter made me have more null date data.
For those who would try this query under Windows, don't forget that you have to escape the '%' characters in BAT queries (this was my case!  ;D).
Title: Re: Export DateTimeOriginal
Post by: StarGeek on May 02, 2020, 10:41:09 AM
Quote from: Sylvain M. on May 02, 2020, 09:41:41 AMFor those who would try this query under Windows, don't forget that you have to escape the '%' characters in BAT queries (this was my case!

As seen in FAQ #27 (https://exiftool.org/faq.html#Q27) or Phil's .sig
;)
Title: Re: Export DateTimeOriginal
Post by: Sylvain M. on May 02, 2020, 11:21:24 AM
Yeah, sorry, I haven't read all the basics yet!
(even if it's good to work in a foreign language, it would be nice if this doc was translated for non-English speakers: translation adds an extra difficulty for non-developers  ;) )
Title: Re: Export DateTimeOriginal
Post by: Sylvain M. on May 02, 2020, 11:24:06 AM
Quote from: StarGeekAs seen in FAQ #27 or Phil's .sig
And in your "Troubleshooting hints" in signature ! Sorry I didn't see it before!
Title: Re: Export DateTimeOriginal
Post by: StarGeek on May 02, 2020, 01:28:19 PM
Ooops, caught me.  Mixed up my .sig with Phil's.