How to Set Current Date from Filename

Advanced Renamer forum
#1 : 11/05-20 01:44
Kalvin
Kalvin
Posts: 1
Hi, I have multiple photos with incorrect date time. But I have renamed the filename previously with format 170512-23134522.jpg.. which is (year month day - hour minute second millisecond. How to set it on advance renamer? Thanks


11/05-20 01:44
#2 : 11/05-20 12:51
David Lee
David Lee
Posts: 447
It depends which timestamp you want to change - EXIF metadata or a Windows timestamp?

Editing a Windows timestamp based on a filename is straightforward using the Timestamp method. You should work with the Modified timedate since the Created date is updated by Windows each time it makes a copy.

Select the "Filename pattern" button and use the pattern: <Year><Month><Day>-<Hour><Min><Sec>

There is a problem, however, since the Timestamp method expects a 4-digit date so you will need to use the Add method to add the first two digits - "20" - to the beginning of each filename. ARen will use the ORIGINAL filename so you must add these digits in a separate batch before using the Timestamp method.

Run the Timestamp method in a second batch and you can add a Remove method to the same batch to delete the two leading digits if you desire.

ARen can only READ EXIF tags so you will need to use another utility if you want to edit or add them. A good option is the full version of ExifTool from https://exiftool.org

ExifTool is a command line utility and looks rather daunting at first but there is plenty of help available online - both in the documentation and in the ExifTool Forum.

I would suggest that you first use ARen to set the Modified timestamps (as above) and then use ExifTool to copy the new timestamps to the image files

eg To edit or add the datetimeoriginal tag you can use the command:

exiftool "-datetimeoriginal<filemodifydate" -P -overwrite_original DIR

where DIR is the folder containing your image files

Note that the exiftool option string must be enclosed in double quotes on a Windows system - many of the examples on the ExifTool forum are intended for other systems and use single quotes, which will lead to an error "The system cannot find the file specified".


11/05-20 12:51 - edited 11/05-20 12:52