Parse Date and Time Info from file name

Started by bennyys, April 19, 2017, 12:44:42 AM

Previous topic - Next topic

bennyys

Let say I Have a file Name as IMG_20161001_155611, when I copy across from Mobile to PC all dates are jump to the copyng date.

What is the right exiftool command to parse date and time info from files name "IMG_20161001_155611" to "2016:10:01 15:56:11" and this kind of info will be written to EXIF DateTime original.

Regards,
Benny

Phil Harvey

Hi Benny,

This is the command:

exiftool "-datetimeoriginal<filename" DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bennyys

Hi Phil,
I try your command in a testing directory with contents of several variation of date and time format.
It works fine and at the end I got this outcome on the report

SourceFile   CreateDate   DateTimeOriginal
IMG20170318135449.jpg   2017:03:18 13:54:49   2017:03:18 13:54:49
IMG20170318135449.jpg_original   2017:03:18 13:54:49   2017:03:18 13:54:49
IMG20170401134628.jpg   2017:04:01 13:46:29   2017:04:01 13:46:28
IMG20170401134628.jpg_original   2017:04:01 13:46:29   2017:04:01 13:46:29
IMG20170401134644.jpg   2017:04:01 13:46:44   2017:04:01 13:46:44
IMG20170401134644.jpg_original   2017:04:01 13:46:44   2017:04:01 13:46:44
IMG20170401142803.jpg   2017:04:01 14:28:04   2017:04:01 14:28:03
IMG20170401142803.jpg_original   2017:04:01 14:28:04   2017:04:01 14:28:04
IMG_20170402_041755.jpg      2017:04:02 04:17:55
IMG_20170402_041755.jpg_original      
IMG_20170402_092428.jpg      2017:04:02 09:24:28
IMG_20170402_092428.jpg_original      
IMG_20170402_205807.jpg      2017:04:02 20:58:07
IMG_20170402_205807.jpg_original      

Thank you very much for your help.

Regards,
Benny