How to insert the date automatically on Mac
You can do this with Note My, and it will type the rest of the header too. Here are the fourteen smart tokens, what each one resolves to, and how to insert a token itself when that is what you actually want.
You are writing a file header, a changelog entry or a note to yourself, and the first thing on the line is today's date. Then the filename. Then your name. None of it is interesting to type, all of it is easy to get subtly wrong, and a date typed by hand late at night is often yesterday's.
Note My handles this with smart tokens: fourteen named placeholders, twelve of which resolve to a value the moment you insert them, while two are editor actions. This guide covers all fourteen, the difference between inserting a token's value and inserting the token itself, and how to expand tokens already sitting in a document.
Where the smart-token menu lives
Smart tokens hang off the Templates menu, which is the toolbar button with a chevron beside it — the one whose tooltip reads "New file from a template, save the current file as one, or insert a smart token". The submenu is Templates ▸ Insert Smart Token.
-
Put the caret where the value belongs
A value token is inserted at the insertion point, like typing, so there is nothing to select first. The two comment tokens are the exception: they act on the selection if there is one.
-
Open the Templates menu and choose Insert Smart Token
The submenu lists all fourteen by their plain-English titles — Date, Date (ISO), Time, Date + Time, Year, Author, User, UUID, File Name, File Base, Project, Cursor and the two comment items.
{{YEAR}} resolved to 2026Forty built-in templates across four groups, plus your own. Smart tokens resolve as the file is created, so a new file arrives with its date, filename and author already filled in. -
Pick the one you want
The value goes straight into the document as ordinary text at the caret. Nothing else in the file moves.
-
Or type it instead
Typing
{{in the editor offers the tokens in the suggestion popup, at the top of the list. ⇥ or ↩ accepts one.
Two routes reach the same fourteen tokens. Take the Templates menu when you want to read the list and pick by its plain-English title; type {{ when you already know the name and would rather not lift your hands off the keyboard.
All fourteen tokens
| Token | Menu title | Resolves to |
|---|---|---|
{{DATE}} | Date | Today's date in long form, for example June 29, 2026 |
{{DATE_ISO}} | Date (ISO) | Today's date as YYYY-MM-DD |
{{TIME}} | Time | The current time, 24-hour HH:mm |
{{DATETIME}} | Date + Time | The current date and time, ISO 8601 |
{{YEAR}} | Year | The current four-digit year |
{{AUTHOR}} | Author | Your name from Settings ▸ Editing, or your macOS account's full name |
{{USER}} | User | Your short macOS login name |
{{UUID}} | UUID | A freshly generated lowercase UUID |
{{FILENAME}} | File Name | The current file's name |
{{FILEBASE}} | File Base | The file's name without its extension |
{{PROJECT}} | Project | A project-name placeholder, for use in templates |
{{CURSOR}} | Cursor | Marks where the caret lands; removed on expansion |
{{COMMENT}} | Comment (line) | An editor action: insert a line comment for this language, or comment the selected lines |
{{COMMENT_BLOCK}} | Comment (block) | An editor action: insert a block comment with the caret inside, or wrap the selection |
Dates and times: three shapes and a year
Which date token you want depends entirely on who reads the line afterwards.
{{DATE}}is the human one — long form, the shape you would write in a changelog heading or a letter.{{DATE_ISO}}is YYYY-MM-DD. Use it for anything that will be sorted, grepped or parsed: log lines, release notes, dated headings.{{TIME}}is the clock alone, 24-hour, hours and minutes. Handy for a running work log where the date sits at the top of the section.{{DATETIME}}is date and time together in ISO 8601 — the stamp for a note that may later be machine-read.{{YEAR}}is the one for copyright lines, and it is what the built-in licence templates use.
All five come from your Mac's clock at the moment you insert them. Nothing is fetched and nothing is uploaded. Once inserted they are ordinary characters — the text does not keep updating itself, which is what you want in a changelog entry.
Identity tokens: author, user, project, filename
{{AUTHOR}} is your byline, spelled the way you sign a source file, and you set it once in Settings ▸ Editing (⌘,). From then on every header you stamp carries that name — every file, every project, for as long as you keep writing. Until you fill the field in, your macOS account's full name stands in, so the token gives you something usable on the very first insertion. {{USER}} is the other one — your short login name, the better choice for a path or a temporary marker.
{{FILENAME}} and {{FILEBASE}} differ by the extension: main.swift against main. {{FILEBASE}} is the one you usually want inside code, because it matches the type or module name the file is expected to declare. Both read the document's name as it stands at the moment you insert them, so give a new file its name with ⌘S and the header comes out right first time — main.swift in the comment because main.swift is what you called it. Rename the file later and a fresh insertion picks the new name straight up.
{{PROJECT}} holds a place open. Drop it wherever a project name belongs and a template arrives with the blanks marked in plain sight, so you fill them in once at the top rather than hunting through the file for the spots you meant to come back to.
Inserting the value, or the token itself
Every value token gets two entries in the submenu, and you choose between them with a modifier key.
| What you do | What lands in the document |
|---|---|
| Choose the item normally | The resolved value, for example 2026-09-02 |
| Hold ⌥ while the submenu is open, then choose | The literal token, {{DATE_ISO}} |
The literal form is what you want when you are writing something that will be expanded later — a document you intend to save as a template, or a header block you will fill in when the file is finally named. Each of the twelve value tokens carries that pairing, so the choice between a finished value and a placeholder is yours every time. The two comment tokens are editor actions, and they do their work the moment you choose them.
Typing a token instead of hunting for it
Type {{ anywhere in the editor and the suggestion popup offers the tokens directly, ahead of the ordinary suggestions. Two details make this pleasant rather than fiddly:
- You are not left with stray braces. Accept a token and the closing braces go with it, so there is no orphaned punctuation to pick out of the line before you carry on typing.
- You are never stuck with a dead popup. If what you typed matches no token —
{{config, say — you get the ordinary suggestions instead.
The popup does not steal your typing, so you can type straight through it; ⇥ and ↩ accept, and each can be switched off on its own. If the popup does not appear, ⌃Space asks for it. This is the faster route once you know the token names.
Expanding tokens already in a document
If a document contains literal tokens — because you inserted them with ⌥, because you started from a template, or because you wrote them by hand — Templates ▸ Expand Smart Tokens in Document resolves every one of them across the whole document at once.
Save first, with ⌘S. The copy on disk is then your escape hatch for a change that sweeps the whole file: File ▸ Reload from Disk (⌘R) brings the document back exactly as you last saved it, and reloading never changes the file on disk. The command resolves every literal token in the whole document in one pass, which is what you want for a header block or a page of release notes — and if a run of literal tokens is sitting there as documentation, escape it first and it comes through untouched.
Escaping a token you want left alone
Write \{{DATE}} and you get a literal {{DATE}} in the text, with the backslash gone. Reach for this when you are documenting the tokens themselves, or drafting a template body to expand later.
Braces that belong to something else
Anything outside the fourteen is left exactly as written. {{TICKET}} stays {{TICKET}}, character for character, so a document that already uses double-brace syntax for a build system or a documentation generator survives an expansion intact. It also means you can leave a marker of your own in the text — a ticket number, a placeholder for a figure — and come back to it later, or sweep the lot in one go with our find and replace.
The two tokens that do something rather than say something
{{COMMENT}} and {{COMMENT_BLOCK}} are editor actions, and they behave differently from the other twelve. {{COMMENT}} inserts the line-comment marker for the document's language, or comments out the selected lines if there is a selection. {{COMMENT_BLOCK}} inserts a block comment with the caret placed inside it, or wraps the selection.
Our syntax engine supplies the marker for the language you are working in, across a very wide spread of them — far wider than the everyday handful. It is a quick way to open a header block without stopping to remember which marker this language wants, and it keeps a template portable: the same saved header comments itself correctly whether the new file turns out to be Swift, Python, SQL or a shell script.
{{CURSOR}} is the third odd one. It carries no text at all: it marks where the caret should land, and it disappears when the document is expanded. Nearly every built-in template uses it, which is why a new file made from one opens with the caret already where you would start typing.
Using tokens in a template you saved yourself
Build the header once, with literal tokens where the values belong, then choose Save Current Document as Template… from the same Templates menu. It joins a fifth group, My Templates, alongside the four built-in groups in our template library — Documents, Licenses, Config and Languages. New files made from it arrive with the tokens already resolved, so the header is written before you type a character.
A workable header for a source file, written with literal tokens:
{{COMMENT}} {{FILENAME}}
{{COMMENT}} {{PROJECT}}
{{COMMENT}} Created by {{AUTHOR}} on {{DATE_ISO}}
{{COMMENT}} Copyright © {{YEAR}}. All rights reserved.
{{CURSOR}}To remove a custom template later, hold ⌥ and click it in the menu; an alternate Delete item appears in its place.
Troubleshooting
I got {{DATE}} in my file instead of the date
The ⌥ key was down when you chose the menu item, so you took the alternate that inserts the literal token. Either delete the token and choose the item again without the modifier, or run Templates ▸ Expand Smart Tokens in Document to resolve what is already there.
Getting the token popup to appear as you type
Smart-token suggestions are one of the switches in Settings ▸ Code Suggestions; check it is on. ⌃Space summons the popup the moment you want it, wherever the caret happens to be, so a token is always a couple of keystrokes away even when you were mid-word and the popup had no reason to open on its own. The menu route sits alongside it: Templates ▸ Insert Smart Token lays out all fourteen under their plain-English titles, so you have a way in whether your hands are on the keys or on the trackpad.
{{AUTHOR}} inserts the wrong name
The name in Settings ▸ Editing is the one that wins; your macOS account's full name is used only when that field is empty. Set the name there and the next insertion picks it up. Text you have already inserted stays as it is.
The filename is out of date after a rename
What lands in the document is ordinary text, which is what keeps an old header honest — the line you stamped last spring still says what it said last spring. To bring a renamed file's header up to date, delete the stale line and insert {{FILENAME}} again; the new name goes in immediately. Better still, if this is a file you create again and again, keep the literal token in a saved template: the name is then written as the file is created, and the header is correct before you have typed a character.
Expand Smart Tokens changed something I wanted left alone
If you saved before running it, File ▸ Reload from Disk (⌘R) brings the file back as it stood on disk, in a single keystroke. Once you are back, put a leading backslash in front of the tokens you want kept as text and run the command again: the escaped ones come through exactly as written, and everything else resolves.
Where the tokens earn their place
- Source headers you never type twice. Build the block once with
{{COMMENT}},{{FILENAME}},{{AUTHOR}}and{{DATE_ISO}}, save it as a template, and every new file opens with the header written, correctly commented for the language, and the caret already sitting on the first real line. - Changelogs and release notes.
{{DATE}}gives the heading a date a reader can take in at a glance;{{DATE_ISO}}gives the same day in the shape that sorts and greps cleanly further down the file. - A running work log. Stamp the date once at the top of the section, then open each entry with
{{TIME}}as you go. Two keystrokes an entry, and the times are the ones your Mac's clock actually says. - Licence and copyright lines.
{{YEAR}}keeps the year right in every file you create from now on, and it is the token the built-in licence templates already use. - Identifiers on demand.
{{UUID}}is fresh on every insertion, so fixtures, migration names and test records get a distinct identifier without a detour to a terminal. - Writing about tokens. A leading backslash keeps one as text, so documentation, README examples and template bodies read exactly as you wrote them.
- Values that come only from your Mac. It all happens on your machine: the date is your clock's, the UUID is made locally, and the author name is a local setting. Nothing is uploaded, there is no account, and your files never leave the Mac.
Frequently asked questions
What exact format does the ISO date use?
{{DATE_ISO}} is YYYY-MM-DD. {{DATETIME}} is a full ISO 8601 date and time. {{TIME}} is 24-hour HH:mm. {{DATE}} is the long human form, such as June 29, 2026.
Does an inserted date update itself later?
Tokens resolve once, at the moment of insertion, and what lands in the document is ordinary text. That is exactly what a changelog entry needs: the line you stamped last March still reads March next year, however often the file is opened. When you want the value worked out afresh each time, keep the literal token in a saved template and every new file made from it arrives with today's date.
What is the quickest way to stamp the date?
Type {{ where the date belongs and accept the suggestion with ⇥ or ↩ — a few keystrokes, and your hands stay on the keyboard. When you would rather see the whole set laid out with their plain-English titles, Templates ▸ Insert Smart Token lists all fourteen.
Can I keep a marker of my own, like a ticket number?
Yes. Write {{TICKET}} and it stays {{TICKET}} — expansion resolves the fourteen and leaves everything else exactly as written, so your marker survives intact. Fill it in by hand when you reach it, or clear every one of them in a single pass with our find and replace.
Where does the UUID come from?
It is made on your Mac, in lowercase, fresh on every insertion. Insert it twice and you get two different identifiers. Nothing is requested from a server: it all happens on your machine, nothing is uploaded, and there is no account.
Should I use a macro or a template for a date stamp?
For a date stamp, reach for a saved template: the tokens resolve as the file is created, so the header is finished before you type a character. Our macro recorder is the tool for the repetitive edits around it — typing, deletion, paste, navigation, selection, find next and previous, replace, Go to Line, save, encoding and line-ending conversion, bookmarks and tab rename — and it tells you at the time exactly what it has captured, so you know where you stand while you record rather than on playback.