Insert the Current Date with a Keyboard Shortcut

Here’s a useful Mac tip to insert the current date in your preferred format nearly anywhere. It does not require any third-party software that can potentially slow down your computer and cost money.

I’ll show you how to add two specific date formats, as well as one for the current time, with this technique. You can use any, all, or a customization that suits your purposes.

You can either download my zip file (recommended) or paste the code into Automator yourself.

With My Downloadable “Quick Actions”

Date and Time Quick

  1. Download this zip file. Unzip it. Place the contents in the correct location.

    • From a Finder window, just use the menu item Go > Go to folder…, enter “~/Library/Services” (no quotes), and hit Return.

    • Then drag the Workflow files you unzipped into the folder.

    • You will probably need to do something to get macOS to recognize these scripts. I recommend simply opening these scripts in Automator (by double-clicking each of them), then closing them. Or just log out of, and then back into, your Mac!

    • If this is successful, then in most applications, you should be able to view your new Quick Actions by clicking the current application name in the menu bar (top left of the screen) and then hovering over Services.

  2. Now let's make these actions available by keyboard shortcuts! Open System Preferences > Keyboard > Shortcuts. Select “App Shortcuts” on the left. Select “All Applications” on the right. Click the Add button (which looks like a plus sign). For “Menu Title,” the exact name of the first Workflow you created; in my case it is “Insert Current Date as ISO”. Then set any shortcut you’d like; I’m rolling with “^⌥⌘M”. (This step works because your Quick Action workflow appears in the menu bar under [App Name] > Services all the time.) I recommend the shortcuts and names in the table below.

    Screen shot during this step Screen shot after this step

  3. Because sometimes the above shortcuts don’t take, for some odd reason, there is one more step for each shortcut. While we are in System Preferences > Keyboard > Shortcuts, Click “Services” on the left, and add a keyboard shortcut for each date/time action. (Don’t see your actions? Take a look at the notes under step 1.) Use the same keyboard shortcut for each action as you did in the previous step! One or the other of these mechanisms should work — at least most of the time.

    Screen shot after this step

  4. That’s it. Now in almost any context, you can invoke your keyboard shortcut to insert the current date in ISO format at your insertion point (where the blinking cursor is, or replacing any currently selected text).

My Date & Time Shortcuts

Name Suggested Shortcut AppleScript
Insert Full Current
Human-Readable Date
tell (current date) to return date string
Insert Current
Date as ISO
tell (current date) as «class isot» as string to return the contents of [text 1 thru 10] as text
Insert Current Time ^⌥⌘T
tell (current date) to return time string

Alternatively, Use Automator Yourself

Here is the manual method in case you don’t trust my downloadable zip.

  1. Open Automator.
  2. Create a new document of type “Quick Action”.
  3. Insert “Run AppleScript” item.
  4. Replace the text with one of the short scripts from the table above. (Safety tip: Ask a trusted programmer friend if the code looks safe.)
  5. Choose “Workflow receives no input in any application,” and check “Output replaces selected text.”
  6. Save it with an appropriate name (my suggestion is to use the corresponding value in the first column of the table above). It should default to the correct location, which is your user directory’s Library/Services file.
  7. Now follow the remaining steps from the downloadable method, starting with step 2.

What About iPhones?

Bonus tip: Do you miss this shortcut on your iPhone or other iOS device? There is an affordable app that provides similar functionality via a software keyboard: TimeStamp Keyboard.

Thanks to CJK for a helpful answer on Stack Overflow that gave me most of what I needed here. Let me know if you liked this tip or have feedback on it.

April 7th, 2022
Alan Hogan (@alanhogan_com).  Contact · About