YYYY-MM-DD Format: Meaning and Examples

YYYY-MM-DD is year, month and day in that order, separated by hyphens. It is the international ISO 8601 date format.

March 5, 2026 in YYYY-MM-DD:

2026-03-05

YYYY = 4-digit year (2026), MM = 2-digit month (03), DD = 2-digit day (05). Months and days below 10 always get a leading zero.

Today's date as YYYY-MM-DD

yyyy-MM-ddYYYY-MM-DD
yyyyMMddWithout hyphens

Uses your device's clock. Paste it straight into a form or a file name.

Copying today's date (yyyyMMdd) into file names every day? InsertDate types it with one press of Insert (Windows, 7-day free trial).

YYYY-MM-DD examples

DateYYYY-MM-DD
January 1, 20262026-01-01
March 5, 20262026-03-05
October 10, 20262026-10-10
December 31, 20262026-12-31
Date of birth: April 7, 19901990-04-07
February 29, 2028 (leap day)2028-02-29

The result is always 10 characters: 4 digits, a hyphen, 2 digits, a hyphen, 2 digits. If a form says "enter the date as YYYY-MM-DD", type the hyphens yourself unless the field adds them for you.

YYYY-MM-DD compared with other formats

FormatMarch 5, 2026Where you see it
YYYY-MM-DD2026-03-05ISO 8601, databases, APIs, many web forms
YYYY/MM/DD2026/03/05Japan and other East Asian countries
YYYYMMDD (yyyyMMdd)20260305File names, IDs, the ISO 8601 basic format
DD/MM/YYYY05/03/2026UK, most of Europe, India, Australia
MM/DD/YYYY03/05/2026United States

The last two rows show why the year-first order matters: 03/05/2026 is March 5 in the US and 3 May in the UK. Nobody reads 2026-03-05 as anything other than March 5, 2026. More on this in Is 08/09/2026 August 9 or September 8?

Why YYYY-MM-DD sorts correctly

Because the largest unit comes first and every part has a fixed width, sorting YYYY-MM-DD text alphabetically gives the same order as sorting by date. 2026-02-28 comes before 2026-03-01, and 2025-12-31 comes before both. Formats that start with the day or month do not sort this way.

Hyphens are allowed in Windows file names, so YYYY-MM-DD also works there. Slashes are not allowed, which is why YYYY/MM/DD cannot be used in a file name.

YYYY-MM-DD in Excel

  • Display a date as YYYY-MM-DD: select the cell, open Format Cells → Number → Custom, and enter yyyy-mm-dd.
  • Get it as text: =TEXT(A1,"yyyy-mm-dd"). On some non-English versions of Excel the format codes are localized; if the result looks wrong, use the custom format instead.
  • Convert 20260305 (text or number) to a date: =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)), then apply the yyyy-mm-dd format.

If the format does not change anything, the cell probably contains text that only looks like a date. Convert it to a real date first.

YYYY-MM-DD in code

LanguageCode
Pythond.strftime("%Y-%m-%d") or d.isoformat() for a date
JavaScriptd.toISOString().slice(0, 10) (this uses UTC, so the day can differ from local time)
JavaDateTimeFormatter.ofPattern("yyyy-MM-dd")
C#d.ToString("yyyy-MM-dd")
SQLThe SQL standard DATE literal is written DATE '2026-03-05'

Watch the letter case in code. In Java and .NET patterns, MM is the month and mm is minutes, so yyyy-mm-dd gives a wrong result. In Java, YYYY is the week-based year, which differs from yyyy around New Year. Documentation writes the format as "YYYY-MM-DD"; code needs the exact case its library expects.

Typing today's date quickly

Typing a date by hand means checking the calendar, adding the leading zeros and the hyphens. On Windows, many apps have their own shortcut for today's date, each in its own format. InsertDate enters today's date with the Insert key in any app, in the yyyyMMdd form (20260305, the ISO 8601 basic format without hyphens). It does not currently output YYYY-MM-DD with hyphens.

Frequently Asked Questions

What does YYYY-MM-DD mean?

YYYY-MM-DD means a four-digit year, a two-digit month and a two-digit day, separated by hyphens. March 5, 2026 is written 2026-03-05. Months and days below 10 get a leading zero.

Is YYYY-MM-DD the ISO 8601 format?

Yes. YYYY-MM-DD is the extended date format of ISO 8601, the international date standard. The same standard also allows the basic format without hyphens, YYYYMMDD (20260305).

How do I write my date of birth in YYYY-MM-DD?

Write the four-digit year, then the month and day as two digits each, with hyphens. A birthday of April 7, 1990 becomes 1990-04-07.

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

Only the separator. Both put the year first, then month, then day. YYYY-MM-DD with hyphens is the ISO 8601 form; YYYY/MM/DD with slashes is common in Japan and other East Asian countries. Slashes cannot be used in Windows file names, hyphens can.

How do I format a date as YYYY-MM-DD in Excel?

Apply the custom number format yyyy-mm-dd to the cell (Format Cells → Custom), or use =TEXT(A1,"yyyy-mm-dd") to get the date as text. The cell must contain a real date value, not text.

Try InsertDate Free for 7 Days

Press Insert. Get today's date as yyyyMMdd (20260305) in every Windows application, including file names in File Explorer.

InsertDate is a Windows 10/11 app. Reading on a phone? Open this page on your PC to install it.