|||

PTPL 137 · There’s only One Right Way to Type the Date

And, no, yyyy and YYYY are not the same thing in an Obsidian template


This article has been edited for clarity

When the last two digits of the year change, as every 12 months they inevitably do, muscle memory tends to work against us. As Johnny Decimal says, don’t type the date by hand! Johnny recommends using Raycast to create a snippet that automatically creates today’s date in the correct format.

Yes, I said correct format because there’s only one right way to type the date but many wrong ways that cause the space-time continuum to shake on its timey-wimey foundations! I’m not talking about the dates you hand write in longhand at the top of a physical page; knock yourself out with those. This is about dates written entirely in numbers.

I’ve known for years that year-month-day is the only format that sorts chronologically in the digital world, but what I didn’t know when this post was published is that of the two ways to write the code that becomes year-month-day dates (yyyy-mm-dd and YYYY-mm-dd), it matters which one you choose.

Both can be correct, in the right context.

Please bear in mind that I’m not a coder. I learn what I need to in order to do what I want to do, and only use the whole yyyy thing in apps like Obsidian, Keyboard Maestro, and Drafts. The information presented here relates to those apps only; not the broader coding world (not that I’d know it if they did!).

This post from David Smith showed me that yyyy is the one most people are looking for. When I was creating Obsidian templates for my weekly notes, however, YYYY was the correct choice. I finally understand why they aren’t and should not be interchangeable. yyyy gives you an independent 4-digit year, while YYYY gives the year relative to the week of the year.1

Forgive me for not explaining it better than that; I have much to learn. If you’re creating templates in Obsidian, just remember that you need to use yyyy if you don’t want the last few days of the year to show the incorrect year.

Your assignment, should you choose to accept it, is to set yourself up with a keyboard shortcut to insert the correctly formatted current date wherever it’s needed. Text Expander and Keyboard Maestro are two capable paid options, or you can follow Johnny’s instructions to use the free utility, Raycast. There are others. ^2

Obsidian has the Natural Language Dates plugin that does the job nicely, but I recommend a system-wide solution that doesn’t just work in one app alone.



💬 I love to hear from readers! Comment via email · Mastodon · Bluesky

If you get value from my work I invite you to share this post with someone you think will like it, or to make a contribution to my support jar. Every gift helps to keep me an independent creator and is greatly appreciated. You may also like to check out the free resources on my productivity themed Gumroad store.

Follow my RSS feed, or sign up to receive posts in your inbox  

 


  1. There’s also gggg and GGGG for week years. I have yet to learn the difference between the Gs and the Ys. See https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/↩︎

Up next PTPL 136 · Why Do New Year’s Resolutions? Every Day is Already a Fresh Start PTPL 138 · Daily Notes Don’t Need to Live in Separate Files
Latest posts PTPL 234 · Tiny experiment: adding a standard paper planner to my plain text planning system Inktober 2026 - Index PTPL 233 · Obsidian’s Smart Lists update is great news for my plain text planner PTPL 232 · AI and autism: careful with policing those quaint turns of phrase, please PTPL 231 · Where Tiny Little Office is big on cuteness, and 3 questions about paper vs digital planning Inktober 2026.31 - Flex Inktober 2026.30 - Cookie Inktober 2026.29 - Tusk Inktober 2026.28 - Trophy Inktober 2026.27 - Dumb PTPL 230 · I drew a paper ruler in my notebook, and raw plain text calendars are still pretty darn great Inktober 2026.26 - Zip Inktober 2026.25 - Fracture Inktober 2026.24 - Bake Inktober 2026.23 - Dapper Inktober 2026.21 - Beacon Inktober 2026.21 - Hero Inktober 2026.20 - Lounge Greetings, fellow earth-visitor Inktober 2026.19 - Confused PTPL 229 · When pencil is more permanant than ink, and appending really is the better way (for me) Inktober 2026.18 - Flightless Inktober 2026.17 - Contraption Inktober 2026.16 - Gangly Inktober 2026.15 - Hooray Inktober 2026.14 - Lady Inktober 2026.13 - Flimsy PTPL 228 · Calendars, todos, and (secret) notes to your future self Inktober 2026.12 - Toss Inktober 2026.11 - Rescue Inktober 2026.10 - Mystical