Why We Write Dates as YYYY-MM-DD

Every date on this site, and every date a PlainTxtOffice app writes to a file, is in the form 2026-09-15: four-digit year, two-digit month, two-digit day, separated by hyphens. This is the calendar date format defined by the international standard ISO 8601. It is a small choice, but it is one of the few formatting decisions that has a clearly correct answer. This post explains why.

The problem with every other format

Take the string 03/04/2026. In the United States that is March 4th. In the United Kingdom, most of Europe, and much of the rest of the world it is April 3rd. There is no way to tell from the string alone; you have to know where the writer lives, and the reader may not. Two-digit years make it worse: 03/04/05 can be read at least three ways. A format that cannot be decoded without outside knowledge is not a format, it is a guess.

2026-03-04 has no such ambiguity. Nobody writes the year in the middle, the four-digit year identifies itself, and once the year is first the only remaining order that anyone uses is year-month-day. The format is self-describing in a way that the alternatives are not.

It is an actual standard

ISO 8601, first published in 1988 and most recently revised in 2019, is the international standard for representing dates and times (ISO). The full standard is large, but its basic calendar date is exactly YYYY-MM-DD. The Internet Engineering Task Force adopted a strict subset of it as RFC 3339, the timestamp format used across internet protocols (RFC 3339). The W3C published its own profile in 1997 for use on the web (W3C NOTE-datetime), and the HTML standard defines the value of every <input type="date"> field as a YYYY-MM-DD string regardless of what the browser shows the user (WHATWG HTML). If you have ever picked a date in a web form, that is the format the page received.

The practical consequence is that every mainstream programming language, database, and spreadsheet can parse YYYY-MM-DD without configuration. It is the one date format you can hand to a program written by a stranger and expect it to work.

It sorts correctly as plain text

This is the property that matters most for plain-text software. ISO 8601 dates are big-endian — the most significant part comes first — and every field is zero-padded to a fixed width. Together, those two rules mean that sorting the strings by character code produces chronological order. No date parsing is needed; the byte order of the text is the time order.

Consider a folder of notes named by date. Sorted alphabetically, the ISO-named files come out in the order they were written:

2025-11-30-meeting.md
2025-12-01-ideas.md
2026-01-15-budget.md
2026-09-15-launch.md

The same files named month-first sort by month across all years, and named without zero-padding they sort 1, 10, 11, 2. Every file manager, every ls and dir command, every spreadsheet’s text sort, and every sort utility gets ISO dates right for free. This is the same principle that makes plain text durable in the first place: the data carries its own meaning, so it does not depend on any particular program to interpret it.

It also extends naturally. Add a time and you get 2026-09-15T14:30:00; add a zone and you get 2026-09-15T14:30:00Z or 2026-09-15T14:30:00-04:00 (both RFC 3339). Each addition keeps the sort property, because each new field is less significant than the one before it and is still fixed-width.

Other things it gets right

  • Searchable. Searching for 2026-09 finds everything from September 2026. Searching for 2026 finds the year. A prefix search is a range query.
  • Four-digit years. Two-digit years caused the Y2K remediation effort; ISO 8601 requires four digits, so the format is unambiguous for the next eight thousand years.
  • Language-neutral. No month names to translate, no locale to configure. 2026-09-15 is the same string in every language.
  • Safe in filenames. Hyphens are legal on every operating system; the slashes in 09/15/2026 are directory separators and cannot be used in a filename at all.

What PlainTxtOffice does

Every date and timestamp our apps store is ISO 8601 — YYYY-MM-DD for dates, RFC 3339 for date-times with a zone. This site’s post dates are configured the same way. Displaying a friendlier form to the user is a presentation choice an app can make; what goes in the file is always the sortable, unambiguous one. If you name your own files by date, we recommend the same.

Sources

  1. International Organization for Standardization. ISO 8601 — Date and time format. https://www.iso.org/iso-8601-date-and-time-format.html
  2. Klyne, G., & Newman, C. (2002). Date and Time on the Internet: Timestamps. RFC 3339, Internet Engineering Task Force. https://www.rfc-editor.org/rfc/rfc3339
  3. Wolf, M., & Wicksteed, C. (1997). Date and Time Formats. W3C Note. https://www.w3.org/TR/NOTE-datetime
  4. WHATWG. HTML Living Standard, §2.3.5 Dates and times. https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#dates