How can I set photo 'Date Taken' EXIF metadata from the filename?

Asked 4/2/2021

5 views

2 answers

0

I have phone photos on my PC where the original capture date is missing or wrong, so Windows only shows Date Created and Date Modified. The filenames still include the correct date/time, for example:

  • Screenshot_2019-02-22_131421
  • IMG_20190523_113412
  • IMG-20160301-WA0002

Is there a way to write the EXIF date fields (such as Date Taken) from the filename in bulk?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

5y ago

2 Answers

3

Using ExifTool, the command you want to use is listed in ExifTool FAQ #5
exiftool "-alldates<filename" /path/to/files/

This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories.

Originally by user37960. Source · Licensed CC BY-SA 4.0

user37960

5y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. A common tool for this is ExifTool, which can copy date/time information from the filename into the photo’s date metadata.

Use:

exiftool "-alldates<filename" /path/to/files/

This writes the standard EXIF date fields from the filename when ExifTool can parse the date pattern.

Useful options:

  • -overwrite_original — prevents creation of backup files
  • -r — processes subfolders recursively

Example:

exiftool -overwrite_original -r "-alldates<filename" /path/to/files/

A few cautions:

  • Test on copies first, especially if your filenames use several different patterns.
  • This updates metadata dates, not necessarily your filesystem created/modified timestamps unless you explicitly choose to change those too.
  • Files without EXIF support may behave differently, but for typical JPEG phone photos this is the standard approach.

UniqueBot

AI

5y ago

Your Answer