File date on photos

Bulk Rename Utility How-To's

File date on photos

Postby mfairleigh » Fri Nov 20, 2020 1:07 am

I have a folder containing over 2,000 .jpg's, all with the file name formatted as "2003-09-14_16-38-21_630.jpg". Obviously a date/time stamp. For some reason, in some cases the file system shows a wildly different file date. I'd like to batch-modify the file dates to correspond to the date/time stamp in the file names. I'm not sure whether there's a way to do that with BRU based on the file name, OR, if I should be looking into using EXIF data and manipulating the file date/time from that. In either case, I'd appreciate any help/examples on how to proceed.

Thank you!

Mike
mfairleigh
 
Posts: 3
Joined: Thu Nov 19, 2020 11:04 pm

Re: File date on photos

Postby Admin » Fri Nov 20, 2020 1:13 am

Hi, BRU will not change timestamps based on the file name but will change file names based on timestamps.
Please see "Change File Timestamps" for the options that are available re changing timestamps. thanks.
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: File date on photos

Postby Luuk » Sat Nov 21, 2020 5:45 am

The exiftool.exe does this for you, but you not say which dates to modify? If filenames have correct date, this to change FileCreateDate and FileModifyDate ...
Code: Select all
exiftool -FileCreateDate"<$Filename" -FileModifyDate"<$Filename"  "YourFolderName"


If filenames not have correct dates, but jpegs have correct Exif:DateTimeOriginal?
This to change FileCreateDate and FileModifyDate = Exif:DateTimeOriginal, and also rename with better exif-date ...
Code: Select all
exiftool -overwrite_original -if $Exif:DateTimeOriginal -FileCreateDate"<$DateTimeOriginal" -FileModifyDate"<$DateTimeOriginal" -FILEname"<${DateTimeOriginal;s/:/-/g;s/ /_/}${filename;s/.*(_\d+)(?i)\.jpg$/$1/}.%le" "YourFolderName"

If you like to test renames on command line, please to change -FILEname into -TESTname so it makes the preview like ...
'2003-09-14_16-38-21_630.jpg' --> 'Exif-Date_Exif-Time_630.jpg'
'2012-09-14_16-38-21_009.jpg' --> 'Exif-Date_Exif-Date_009.jpg'

Then when to be happy with names, change back to -FILEname to conduct all the dates, and also to rename.
Luuk
 
Posts: 704
Joined: Fri Feb 21, 2020 10:58 pm

Re: File date on photos

Postby mfairleigh » Sat Nov 21, 2020 3:46 pm

Thank you Luuk, I will play with this!

Mike
mfairleigh
 
Posts: 3
Joined: Thu Nov 19, 2020 11:04 pm


Return to How-To