YYYY-MM-DD Year, Month, Day

The ISO 8601 date format: what yyyy-mm-dd means, why it sorts correctly, who uses it, and how to write it in spreadsheets and code.

Last reviewed on 28 November 2026.

What YYYY-MM-DD means

YYYY-MM-DD is a date written year first: four digits for the year, two for the month and two for the day, separated by hyphens. 2 October 2026 is 2026-10-02. It is the calendar date format defined by the international standard ISO 8601.

Today in YYYY-MM-DD:

2026-10-02
  • YYYY is the full four-digit year.
  • MM is the month number, 01 (January) to 12 (December).
  • DD is the day of the month, 01 to 31.

The units run from largest to smallest, the same way a clock time runs from hours to seconds. That gives the format two properties no other common date format has: nobody reads it in a different order, and it sorts chronologically even when it is treated as plain text. Those two properties are why databases, APIs, file names and programmers use it.

YYYY-MM-DD converter and checker

Pick a date to see it written in YYYY-MM-DD, or paste a date to check that it is valid. Everything runs in your browser.

Write a date as YYYY-MM-DD

YYYY-MM-DD
–

YYYYMMDD
–
YYYY/MM/DD
–
YYYY.MM.DD
–
YYYY-MM
–

Read a YYYY-MM-DD date

Try:

The three parts

CodeMeaningAllowed valuesIn 2026-10-02
YYYYYear, four digits0000–99992026
MMMonth number, two digits01–1210 (October)
DDDay of the month, two digits01–31 (01–28, 29 or 30 in shorter months)02
-SeparatorA hyphen-

YYYY on its own simply means a year written with all four digits, such as 2026; YY means the last two, 26. A full YYYY-MM-DD date is always exactly ten characters.

YYYY-MM-DD examples

DateYYYY-MM-DDYYYYMMDDYYYY/MM/DD
1 January 20262026-01-01202601012026/01/01
14 February 20262026-02-14202602142026/02/14
29 February 20282028-02-29202802292028/02/29
7 May 20072007-05-07200705072007/05/07
2 October 20262026-10-02202610022026/10/02
2 November 20262026-11-02202611022026/11/02
25 December 20262026-12-25202612252026/12/25
31 December 19991999-12-31199912311999/12/31

The rules that make it ISO 8601

Why programmers write year, month, day

It sorts correctly as text

Because the biggest unit comes first and every part has a fixed width, alphabetical order and date order are the same thing. A folder of files named this way lists itself in date order with no extra work:

2025-12-31-report.pdf
2026-01-05-report.pdf
2026-10-02-report.pdf
2027-01-01-report.pdf

The same files named day first would sort as 01-01-2027, 02-10-2026, 05-01-2026, 31-12-2025, which is no order at all.

It has one reading

02/10/2026 is 2 October in London and February 10 in New York. 2026-10-02 is 2 October everywhere, because no country writes year-day-month.

Software already expects it

Which countries use YYYY-MM-DD?

Year-month-day is the everyday order for well over a billion people, though the separator varies:

CountryTypical form2 October 2026
Sweden, LithuaniaYYYY-MM-DD2026-10-02
ChinaYYYY-MM-DD or YYYY/MM/DD2026-10-02, also 2026年10月2日
Japan, TaiwanYYYY/MM/DD2026/10/02
South Korea, HungaryYYYY. MM. DD.2026. 10. 02.
CanadaYYYY-MM-DD (government recommendation)2026-10-02
South AfricaYYYY/MM/DD or YYYY-MM-DD (official standard)2026/10/02

In most other countries it is the format of technical and official contexts rather than daily life. Germany, for example, recognises it alongside DD.MM.YYYY. See the country table for the full list.

Variants: YYYYMMDD, YYYY/MM/DD, YYYY.MM.DD

Pattern2 October 2026Notes
YYYY-MM-DD2026-10-02ISO 8601 extended format; the one to use by default
YYYYMMDD20261002ISO 8601 basic format; file names, batch files, database keys
YYYY/MM/DD2026/10/02Everyday form in Japan, Taiwan and South Africa; not ISO 8601
YYYY.MM.DD2026.10.02Used in chess game records (PGN files, including Lichess studies), where unknown parts are written 2026.??.??
YYYY-MM2026-10Month precision
YYYY-MM-DD HH:mm:ss2026-10-02 14:05:09The usual SQL timestamp layout; strict ISO 8601 puts a T where the space is
YY-MM-DD26-10-02Avoid: without the century it is ambiguous

YYYY-MM-DD or YYYY-DD-MM?

It is always YYYY-MM-DD. Year-day-month is not a standard and is not the convention of any country, so a date that starts with a four-digit year can be read as year, month, day. If you meet 2026-13-02, it is an error, not a different format. The one place the wrong reading can appear is old SQL Server code, described below.

YYYY-MM-DD in Excel, Google Sheets and Word

YYYY-MM-DD in code

Each line below prints 2026-10-02 for 2 October 2026.

Language or toolFormat a date as YYYY-MM-DDPattern
Excel, Google Sheets=TEXT(A1,"yyyy-mm-dd")yyyy-mm-dd
JavaScriptd.toISOString().slice(0, 10) (UTC date)none needed
Pythond.isoformat() or d.strftime('%Y-%m-%d')%Y-%m-%d
JavalocalDate.toString() or DateTimeFormatter.ISO_LOCAL_DATEyyyy-MM-dd
C# / .NETd.ToString("yyyy-MM-dd")yyyy-MM-dd
PHP$d->format('Y-m-d')Y-m-d
MySQLDATE_FORMAT(d, '%Y-%m-%d')%Y-%m-%d
PostgreSQL, OracleTO_CHAR(d, 'YYYY-MM-DD')YYYY-MM-DD
SQL ServerCONVERT(char(10), d, 23)style 23
Shelldate +%F%F or %Y-%m-%d

Four traps

A regular expression for YYYY-MM-DD

^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$

This checks the shape only: it accepts 2026-02-31. Follow it with a real date check, as the checker above does.

Frequently asked questions

What does YYYY-MM-DD mean?

YYYY-MM-DD means year, month, day: a four-digit year, a two-digit month (01 to 12) and a two-digit day (01 to 31), separated by hyphens. 2 October 2026 is written 2026-10-02.

What is an example of the YYYY-MM-DD format?

Christmas Day 2026 is 2026-12-25, New Year's Day 2026 is 2026-01-01 and 7 May 2007 is 2007-05-07. Month and day always have two digits.

Is YYYY-MM-DD the ISO 8601 format?

Yes. It is the extended calendar date format of ISO 8601. The same standard also allows the basic format YYYYMMDD with no separators. Forms with slashes or dots, such as 2026/10/02, use the same order but are not ISO 8601.

Which countries use YYYY-MM-DD?

Sweden and Lithuania use it in everyday life, and China, Japan, South Korea, Taiwan and Hungary write the year first with their own separators. Canada and South Africa recommend it officially. Elsewhere it is mainly used in technical, scientific and government contexts.

Why do programmers write the year first?

Because dates written YYYY-MM-DD sort chronologically as plain text, have a fixed length, and cannot be confused between day-first and month-first readers. That makes them reliable in file names, logs, databases and APIs.

Is it YYYY-MM-DD or YYYY-DD-MM?

YYYY-MM-DD. Year-day-month is not a standard and no country uses it, so a date that begins with a four-digit year is read as year, month, day.

What does YYYY mean in a date?

YYYY means the year written with all four digits, such as 2026. YY means only the last two digits, 26. Four digits remove any doubt about the century.

How do I get YYYY-MM-DD in Excel?

Select the cells, press Ctrl+1, choose Custom and enter yyyy-mm-dd. To build the text in a formula, use =TEXT(A1,"yyyy-mm-dd").

What is the difference between YYYY-MM-DD and YYYY/MM/DD?

Only the separator, but it matters to software. The hyphen form is the ISO 8601 standard and is understood by virtually every parser. The slash form is the everyday style in Japan and Taiwan and is not guaranteed to parse the same way everywhere.

Related reading