Can I add the file last update date to the file name?

Bulk Rename Utility How-To's

Can I add the file last update date to the file name?

Postby BillH99999 » Tue Sep 02, 2025 11:01 pm

I searched around, but didn't find anything on this. Is there a way in BRU to add the last update date for a file to the file name?

Thanks,
Bill
BillH99999
 
Posts: 2
Joined: Tue Sep 02, 2025 10:57 pm

Re: Can I add the file last update date to the file name?

Postby Admin » Wed Sep 03, 2025 1:50 am

Quick (no-script) way

- Use Auto Date (8).
- Set Date Type = Modified.
- Choose Format (one of the built-ins or a custom format), Seg./Sep./Cent. as needed.
- Choose Prefix or Suffix.
- Preview the New Name column, then click Rename.

Notes:
- If you are also changing file timestamps as part of the same operation and want to use the new timestamp value, choose Modified (New).
- For photos you may prefer Item Date or EXIF Taken types (EXIF available only for JPG/TIFF/NEF/CR2).
- Preview first and back up important files before running bulk operations.

Advanced / custom formatting (JavaScript)
If you need a custom timestamp format not available in Auto Date, use the Javascript renaming (Special (14)). Example that prepends a Modified timestamp including time:

var d = object("modified");
newName = formatDateTime(d, "YYYY-MM-DD_HH-mm-ss") + "_" + name;

(Then run the JS renamer. newName must not include the extension.)
Admin
Site Admin
 
Posts: 3054
Joined: Tue Mar 08, 2005 8:39 pm

Re: Can I add the file last update date to the file name?

Postby BillH99999 » Wed Sep 03, 2025 2:57 am

Works like a charm.

Thanks!!
BillH99999
 
Posts: 2
Joined: Tue Sep 02, 2025 10:57 pm

Re: Can I add the file last update date to the file name?

Postby TheGhost78 » Wed Sep 03, 2025 10:49 am

If you want to remove an existing date or date time and update it to the latest modified date or date time, in the format Filename, 2025-09-03 or Filename, 2025-09-03 10.38.10:

RegEx (1)
Match: (.+)(, \d{4}-\d{2}-\d{2})( \d{2}\.\d{2}\.\d{2})?$
Replace: \1

Auto Date (8)
Mode: Suffix
Type: Modified (Current)
Format: Custom
Sep.: , (comma space)
Custom: %Y-%m-%d or %Y-%m-%d %H.%M.%S

It would work for files that do not currently have a date or date time as well, as the RegEx (1) part simply won't do anything to those filenames but the Auto Date (8) part will still fire.
If you want to use different separators, just change them in both the Match portion of RegEx and the Sep. and Custom portions of Auto Date.
TheGhost78
 
Posts: 216
Joined: Fri Jul 19, 2024 11:25 am


Return to How-To