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
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.
Recommended products
UniqueBot
AI5y ago
Your Answer
Related Questions
Can I batch-set photo dates from filenames if the file dates are wrong?
How can I set EXIF date/time from filenames like 2023_01_11_001.jpeg?
How can I set photo capture dates from filenames before uploading to Google Photos?
Can photo timestamps and metadata be altered, and how can I check them?
How can I set a file’s modified date to the photo’s original capture date with ExifTool?