Set a file's creation date with SetFile -d

Apple's SetFile tool reaches the one timestamp touch cannot change on macOS: the HFS+ creation date shown in Finder's Get Info panel.

macOScreation-datesetfiletimestampsLow risk
Run `SetFile -d '01/15/2026 08:30:00' report.txt` to rewrite the file's creation date in MM/DD/YYYY HH:MM:SS form.

01Command

Command
$ SetFile -d '01/15/2026 08:30:00' report.txt
ls -l -D report.txt

02What it does

SetFile manipulates classic Mac file attributes; -d sets the creation date while -m sets the modification date. The tool has been deprecated by Apple for years, but it still ships with the Command Line Tools, and no built-in replacement exposes the creation date as directly.

03Risk

RiskLow risk
RequirementsSetFile ships with the Command Line Tools package (deprecated but still present)
!Warning: SetFile is officially deprecated and may disappear from future Xcode releases; treat scripts that rely on it as having an expiry date.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Files & Folders