Add Date to File Name: Created, Modified or Today's Date
Add a date to a file name on Windows or Mac with PowerRename, PowerShell, Power Automate, Finder or Terminal, which date each one uses, and how to date new files.
Every tool that can add a date to a file name makes you answer one question first: which date? PowerRename on Windows uses the date a file was created, Finder on a Mac only knows today's date, and PowerShell, Power Automate and Terminal can use any of the three. For files that keep arriving, a rule-based renamer such as File Arbor dates each one as it lands.
This guide starts with picking the right date, because that choice decides which tool works. Then it covers the built-in options on Windows 11 and macOS, step by step, and ends with the one job none of them does on its own: dating new files without you.
Which Date Belongs in the File Name?
A file carries several dates, and they often disagree. A PDF you downloaded today from a 2024 email has a 2024 date in its content, today's creation date on your disk, and possibly a modified date from somewhere in between.
| Date | What it records | Good for |
|---|---|---|
| Today's date | The moment you rename the file | Marking when you filed, sent or received something |
| Date created | When this copy appeared on this disk | Downloads and scans, where arrival is what matters |
| Date modified | When the content was last saved | Documents, drafts and exports, where the content date matters |
| Date taken | When a photo was shot, from its EXIF data | Photos, which get copied too often to trust the file dates |
| A date inside the document | The invoice or statement date printed on it | Invoices, receipts, bank statements |
The created date is the one that surprises people. On Windows it belongs to the copy, not the content: copy a 2019 spreadsheet to a new drive today and its created date is today, while its modified date still says 2019. That is why a file can look "created" after it was "modified".
The last row needs a tool that reads the document itself. We cover that in a separate guide to renaming PDF files based on their content.
Write the Date So It Sorts
Put the date at the start of the name, as year-month-day: 2026-11-06 contract.pdf. In that order, alphabetical sorting is date sorting, so File Explorer and Finder line files up by date without a Date column. 11-06-2026 sorts by month and then by day, which mixes years together.
Three rules keep names portable:
- No slashes.
/and\separate folders, so no file name can contain them. - No colons. Windows refuses
:in a file name. Write a time as14-30or1430. - One separator style. Pick hyphens or underscores and keep to them; a mix is harder to search.
Our guide to file naming conventions covers what goes after the date.
Windows: PowerRename for the Date Created
PowerRename comes with Microsoft PowerToys, a free download from Microsoft. Its date variables read each file's creation date, which makes it the quickest way to date a batch of downloads or scans.
- Install PowerToys and make sure PowerRename is switched on in its settings.
- Select the files in File Explorer, right-click and choose Rename with PowerRename.
- Tick Use regular expressions.
- In Search for, type
^. In a regular expression, that means "the start of the name". - In Replace with, type
$YYYY-$MM-$DD_. - Set Apply to to Filename only, so the extension stays as it is.
- Check the preview pane, then click Apply.
report.pdf, created on 6 November 2026, becomes 2026-11-06_report.pdf. Add the time with $hh-$mm. Ctrl+Z in File Explorer undoes the rename.
For photos, PowerRename has a second set of variables that read the EXIF date taken, such as $DATE_TAKEN_YYYY. Choose the EXIF/XMP option in its menu to use them. What PowerRename has no variable for is the date modified.
Windows: PowerShell for Any Date
PowerShell can read every date a file has, so it is the tool for the date modified or today's date. Open PowerShell, go to the folder, and run this first:
cd "$HOME\Documents\Scans"
(Get-ChildItem -File) | Rename-Item -NewName { $_.LastWriteTime.ToString('yyyy-MM-dd') + ' ' + $_.Name } -WhatIf
-WhatIf prints what would happen and changes nothing. When the list looks right, press the up arrow, delete -WhatIf and run it again. The parentheses around Get-ChildItem make PowerShell collect the file list before renaming, so no file gets picked up twice.
Swap the date in the middle to change what goes in the name:
| You want | Use |
|---|---|
| Date modified | $_.LastWriteTime.ToString('yyyy-MM-dd') |
| Date created | $_.CreationTime.ToString('yyyy-MM-dd') |
| Today's date | (Get-Date).ToString('yyyy-MM-dd') |
| Date and time | $_.LastWriteTime.ToString('yyyy-MM-dd HH-mm') |
In these format strings MM is the month and mm is minutes. Run the line only once per folder: a second run puts a second date in front of the first. Old batch-file tricks with %date% are best avoided, because the format of that variable follows the computer's regional settings.
Windows: Power Automate for Desktop, Without Code
Power Automate for desktop comes with Windows 11 at no extra cost and can be installed on Windows 10. Its Rename file(s) action has a scheme built for this job.
- Create a new flow and add Get files in folder. Pick the folder and, if you like, a filter such as
*.pdf. - Add Rename file(s) and pass it the
%Files%variable from the first step. - Set Rename scheme to Add datetime.
- Set Datetime to add to Last modified, Creation time or Current datetime.
- Set Add datetime to Before name, pick a Separator, and change Datetime format from the default
yyyyMMddtoyyyy-MM-ddif you want hyphens. - Save and run the flow.
It does the same job as the PowerShell line, with menus instead of code. Like the script, it runs when you start it, and running it twice adds a second date.
Mac: Finder Adds Today's Date, Terminal Adds the File's Date
Finder's batch rename can add a date, but only one kind. Select the files, Control-click one of them, choose Rename, then pick Format in the pop-up menu and Name and Date as the name format. Every file gets the current date and time, down to the second, placed before or after the name. That is right when you want "the day I filed these" and wrong for anything else.
For each file's own date, use Terminal. This loop prints what it would do:
cd ~/Documents/Scans
for f in *; do
[ -f "$f" ] || continue
d=$(stat -f %Sm -t %Y-%m-%d "$f")
echo mv -n "$f" "$d $f"
done
%Sm is the date modified. Change it to %SB for the date created, the birth time in macOS's stat. When the printed commands look right, delete echo and run the loop again. mv -n never overwrites a file that already has the new name. As on Windows, a second run adds a second date.
What Each Tool Can Put in the Name
| Feature | PowerRename | PowerShell | Power Automate | Finder | Terminal (Mac) | File Arbor |
|---|---|---|---|---|---|---|
| Platform | Windows | Windows | Windows | Mac | Mac | Windows and Mac |
| Today's date | No | Yes | Yes | Yes | Yes | No |
| Date created | Yes | Yes | Yes | No | Yes | Yes |
| Date modified | No | Yes | Yes | No | Yes | Yes |
| Photo date taken | Yes | With extra code | No built-in option | No | With extra code | Yes |
| Dates new files on its own | No | No | No | No | No | Yes, with Auto Mode (Pro) |
| Same file never dated twice | No | No | No | No | No | Yes |
| Price | Free | Free | Free with Windows | Free | Free | Free plan, Pro $24.99 one-time |
How Do You Add the Date to New Files Automatically?
Every method above works on the files that are already there. None of them notices the scan that arrives tomorrow, and if you run them again, they date yesterday's files a second time. Neither Windows nor macOS has a setting that stamps new files with a date.
File Arbor is a rule-based file organizer for Windows and Mac that fixes both problems. A rule picks files, and its Rename action builds a new name from parts:
- Add the folder the files land in, such as Scans or Downloads.
- Create a rule that matches the file types, for example the extension
pdf, docx. - Under Then, choose Rename. Click Add part and pick File date, then Original name. Set Between parts to a space or
_. Click the date part to choose how it is written:2026-11-06,20261106or06.11.2026. - Check What a run does, which lists every file with its new name before anything changes.
- Press Run, or switch the folder to Auto Mode so each new file is renamed as it arrives.
File date is the date modified. For photos, pick Photo capture date instead, which reads the EXIF date and falls back to the file date when a photo has none. For the date created, click Edit as text and write <CreatedDate:yyyy-mm-dd> <Name>. In the same view, File date and Original name appear as <Date:yyyy-mm-dd> and <Name>.
Three details matter more than they look. A file is renamed once: the rule remembers what it named, so a restart or the next run never produces 2026-11-06 2026-11-06 scan.pdf. Nothing is overwritten: when the new name is taken, the file gets a number, such as invoice (1).pdf. A rename can be undone from History, as long as the file is still where the rule left it. File Arbor has no "today's date" part; for a file that just arrived, its File date is usually today anyway.
Renaming is on the free plan: one watched folder, two rules, up to 20 files a day, manual runs. File Arbor Pro is $24.99 one-time and adds Auto Mode, unlimited folders and rules, and names built from a date read inside a PDF or a scan. The Renaming files section of the manual lists every part a name can use.
Which One Fits Your Files?
"I have one folder of downloads to date, on Windows." Use PowerRename. Creation date is what you want here, and the preview shows every new name before you apply it.
"I need the date the document was last changed." Use PowerShell with LastWriteTime, or Power Automate for desktop with Last modified if you'd rather not type code.
"I'm on a Mac." Use the Terminal loop. Use Finder only when today's date is the date you want.
"These are photos." Use the date taken: PowerRename's EXIF variables for a one-off batch, or File Arbor's Photo capture date for a camera folder that keeps filling up.
"New files arrive every day, and I want them dated without thinking about it." Use File Arbor. Set the rule once and new scans, invoices and exports get a date-first name, on Windows and Mac. Compare it with batch renamers in our roundup of file renaming software.
To try it on your own folder, download File Arbor, add the folder, and build one Rename rule with File date and Original name. The preview shows what it will do before a single file changes.
FAQ
How do I add the date to a file name automatically?
Use a tool that watches the folder. Windows and macOS have no setting that stamps new files with a date. A scheduled PowerShell script or Terminal loop can do it, but it adds the date again on every run unless you filter out names that already have one. File Arbor renames each new file once, with Auto Mode in Pro or a manual run on the free plan.
How do I rename files with their date created on Windows?
Use PowerRename from Microsoft PowerToys. Select the files, choose Rename with PowerRename, tick Use regular expressions, search for a caret and replace it with the year, month and day variables plus a separator. Those variables come from each file's creation date. For the date modified instead, use PowerShell with LastWriteTime or Power Automate for desktop.
Can Finder add a file's own date to its name on a Mac?
No. Finder's Rename window can add a date with its Format option, but it is the current date and time, the same for every file. For the date a file was created or last modified, use a short Terminal loop with the stat command, or a rule-based app that reads the file date for each file separately.
What date format should I use in a file name?
Use year-month-day with hyphens, such as 2026-11-06, at the start of the name. Names in that form sort by date in File Explorer and Finder because alphabetical order and date order become the same. Avoid slashes, which no file name can contain, and colons, which Windows refuses; write a time as 14-30 instead of 14:30.
Why is a file's created date later than its modified date?
Because the file was copied or downloaded. On Windows the creation date belongs to the copy on this disk, so a file copied today is created today even if its content was last changed years ago. The modified date usually travels with the file. When you want the date the content dates from, the modified date is often the better choice.