Reformat date in file name how-to tutorial

Bulk Rename Utility How-To's

Reformat date in file name how-to tutorial

Postby Admin » Sat Oct 04, 2025 12:53 am

Here’s a compact step-by-step tutorial for using Bulk Rename Utility’s Reformat Date (Name (2)) and related date features, plus examples and tips.

Quick overview
- Reformat Date (Name (2)) scans the filename for a date, then rewrites that date into a standard (or custom) format.
- You can use the built-in automatic detection or give a custom rule to parse unusual date layouts.
- Auto Date (8) and the tag/formatter system ({date:...}) are separate but related: Name(2) Reformat helps convert a date already in the name; Auto Date inserts timestamps taken from file metadata or “Current” date.

How to use Reformat Date (GUI)
1. Select the files in BRU.
2. Go to the Name (2) panel.
3. Set box to Reformat Date inside Name (2).
4. If you want the default output (YYYY-MM-DD) leave the box blank. BRU will try to detect any date in the filename and convert it to YYYY-MM-DD.
5. To use a custom output format, enter your desired format string in the Reformat Date box (see format options below).
6. Preview the New Name column. When satisfied, click Rename.

Common built-in behavior
- Default target format: YYYY-MM-DD.
- Detection tries many common date patterns (e.g., DD-MM-YYYY, MM/DD/YYYY, YYYY.MM.DD, etc.).
- If BRU cannot reliably detect the source format it will not change that file name — use a custom rule to force recognition.

Custom reformatting rules (syntax)
You give BRU a mapping that tells it how to interpret the date that’s already present, and (optionally) the target format. Use % codes (the same as Auto Date custom formats). Two main modes:

A) Simple target format only (BRU detects source automatically)
- Example: enter %Y_%m_%d to output 2023_10_21 (if a date is found).

B) Source>Target mapping for unusual input
- Format: sourcePattern > targetPattern
- Example: %d+%m+%Y>%d %m %Y
- Interprets an input like 01+04+1999 (source %d+%m+%Y)
- Outputs 01 04 1999 (target %d %m %Y)

Supported % tokens (source and target)
- %a Abbreviated weekday name
- %A Full weekday name
- %b Abbrev month name
- %B Full month name
- %d Day of month (01–31)
- %H Hour (00–23)
- %I Hour 12-hour (01–12)
- %j Day of year (001–366)
- %m Month number (01–12)
- %M Minute (00–59)
- %p AM/PM
- %S Seconds (00–59)
- %U Week number (Sun first)
- %w Weekday (0=Sun … 6=Sat)
- %W Week number (Mon first)
- %y 2-digit year
- %Y 4-digit year
- %z Time zone name
- %% Literal percent

Upper/lowercase control
- Prefix the target format with |U to uppercase the produced date text, or |L to lowercase it.
- Example: |U%d-%b-%Y => 14-JUN-2024

Alternate JS-style token option
- You may use brace-style tokens inside { } with JS-style tokens (if supported in that field): e.g. {YYYY-MM-DD} => 20250908_170109 etc.
- Supported tokens: YYYY, YY, MMMM, MMM, MM, DD, dddd, ddd, HH, hh, mm, ss, AA, WW, ww, ee, ZZ.

Examples (Reformat Date uses)
1) Convert many variants to ISO
- Input: Meeting_12-31-2023.docx
- Reformat Date (blank or %Y-%m-%d)
- Result: Meeting_2023-12-31.docx

2) Unusual separators
- Input: Photo_01+04+1999.jpg
- Reformat Date: %d+%m+%Y>%d %m %Y
- Result: Photo_01 04 1999.jpg

3) Add weekday and month name
- Input: Event_01-04-2024.png
- Reformat Date: %a-%b-%d-%Y
- Result: Event_Sun-Apr-01-2024.png

4) Keep other text, only reformat the found date
- Input: Backup (03.07.21) - file.txt
- Reformat Date: %d.%m.%y>%Y-%m-%d
- Result: Backup (2021-07-03) - file.txt

When Reformat Date may fail or produce nothing
- If the filename uses a very unusual date format not recognized by BRU’s detection, you must give an explicit source pattern (left of >).
- If multiple ambiguous date-like numbers exist, BRU might not pick the intended one — consider using a RegEx (option 1) or the Name Segment controls to restrict the area BRU checks.
- Reformat Date only changes the name portion (not the file extension). If you need to include extensions in detection, be careful and consider RegEx (or the advanced option to treat extensions as part of name).

Advanced alternatives
- RegEx (1): Use a regular expression to extract and rewrite dates if you need pattern matching and reordering not covered by Reformat Date. RegEx runs earlier in the pipeline.
- Name Segment: Limit Reformat Date to a specific name region (first N chars, between delimiters, etc.) so BRU focuses correctly.
- JavaScript renaming: for ultimate control you can use the JS engine to parse text with complex logic, use filePropertyDate(...) or exif(...) and format via formatDateTime(), then set newName.

Date formatting inside tags / formatters (when using tags)
- If using a tag that is a date (e.g., <($System.ItemDate)>) you can use {date:pattern} or the shorthand {YYYYMMDD}.
- Example tag: <($System.ItemDate){date:YYYY-MM-DD}> => 2025-08-14
- Useful when constructing a Fixed name using tags in Name (2) or in Add (7).

Tips and troubleshooting
- Preview first — check New Name for each file before renaming.
- If BRU doesn’t detect a date, create an explicit source pattern: %d%-%m%-%Y > %Y-%m-%d (adapt separators).
- Use Name Segment or RegEx when there are multiple numbers/dates in the name.
- For photo EXIF dates (date taken), Auto Date (8) or <($exif:DateTimeOriginal){date:...}> are the right places to insert metadata dates (Reformat Date only modifies dates already in the filename).
Admin
Site Admin
 
Posts: 3096
Joined: Tue Mar 08, 2005 8:39 pm

Return to How-To