Main Menu

Export DateTimeOriginal

Started by Sylvain M., May 01, 2020, 05:11:33 PM

Previous topic - Next topic

Sylvain M.

Related to this topic, 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 !

StarGeek

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?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sylvain M.

#2
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  !

Sylvain M.

QuoteI will try  !
Unfortunately, no... It's not working  :'(

StarGeek

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 and add
-d "%Y:%m:%d %H:%M:%S"
This should work either way.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sylvain M.

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).

StarGeek

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 or Phil's .sig
;)
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sylvain M.

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  ;) )

Sylvain M.

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!

StarGeek

Ooops, caught me.  Mixed up my .sig with Phil's.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).