ExifTool > ExifTool GUI

Set Date Taken from File Name

(1/3) > >>

rewallac:
I have a folder of photos which have the date taken in the file name. How to I set the EXIF date taken from the file name?

2016-10-06_17-59-46.295790.jpg
2016-10-10_17-28-47.765140.jpg
2016-10-17_17-53-49.384150.jpg

YYYY-MM-DD_??-??-??.??????.jpg (Logically it would seem that the format is YYYY-MM-DD_HH-mm however, based on the content the hour/minute does not appear to me to be in the filename. However, I will accept those values as the hour/minute if I have to.

Phil Harvey:
If you do this:

exiftool "-datetimeoriginal<filename" DIR

then the year, month, day, hour, minute, second will be set from the file name.  (See FAQ 5 for why this works.)

If you want to set the minutes and seconds to zero, you can so this:

exiftool "-datetimeoriginal<${filename;$_=substr($_,0,13)} 00:00" DIR

This is assuming you want to set EXIF DateTimeOriginal.  You could also set CreateDate and/or ModifyDate if you want, or use AllDates (a shortcut tag) to set all three together.

- Phil

rewallac:
PERFECT!

THANKS PHIL!

Azertix:
Hello and thanks for your tool 8)
I want to do the same thing but my files are named "IMG-20190907-WA0025" (Whatsapp files).
Is it possible ?

Thank you ;D
Azertix

Phil Harvey:
Hi Azertix,

That same command should work for you.

- Phil

Navigation

[0] Message Index

[#] Next page

Go to full version