What DD, MM, YYYY, MMM, DDMMYY, DD-MON-YYYY, %d/%m/%Y and hh:mm tt actually mean, and how to write the same date in every tool.
Last reviewed on 2 October 2026.
A date format code (also called a pattern, picture or format string) is a template that tells software how to write a date: DD for the day, MM for the month, YYYY for the year, and so on. The letters look universal, but they are not: mm is minutes in one tool and month in another, and YYYY can quietly mean a different year near New Year. Type any pattern into the tester below to see what it produces, then use the tables to translate it between Excel, Word, strftime, PHP, Java, .NET, JavaScript libraries and SQL. Every example on this page uses Friday 2 October 2026, 14:05:09.123.
Type a pattern such as DD-MMM-YYYY, dd/mm/yyyy hh:mm, %d/%m/%Y or a Word field like { DATE \@ "dd.MM.yyyy" }. The output updates as you type.
| Code | Meaning | Output |
|---|
How the tester reads codes: D and Y are case-insensitive. H is a 24-hour clock and h a 12-hour clock. M/m is read as minutes when it directly follows an hour code or directly precedes a seconds code (the same rule Excel uses), or when the pattern also contains uppercase MM for the month; otherwise it is the month. Text inside [brackets], 'single quotes' or "double quotes" is copied as-is. Patterns containing % codes are read as strftime.
These are the building blocks used by most "human-readable" pattern styles (Excel, Moment, .NET and the generic notation found on forms). Upper/lower case matters in many tools; the cross-tool table below shows the exact letters each one expects.
| Token | Meaning | Example (2 Oct 2026, 14:05:09.123) |
|---|---|---|
| YYYY / yyyy | Year, 4 digits | 2026 |
| YY / yy | Year, last 2 digits | 26 |
| Q | Quarter of the year (1–4) | 4 |
| MMMM | Month name, full | October |
| MMM | Month name, abbreviated (3 letters in English) | Oct |
| MON | Month abbreviation, Oracle/SQL style (case follows the code) | OCT |
| MM | Month number, 2 digits (leading zero) | 10 |
| M | Month number, no leading zero | 10 (March = 3) |
| DDDD / dddd | Weekday name, full | Friday |
| DDD / ddd | Weekday name, abbreviated | Fri |
| DD / dd | Day of month, 2 digits | 02 |
| D / d | Day of month, no leading zero | 2 |
| WW | ISO 8601 week number, 2 digits | 40 |
| HH | Hour, 24-hour clock, 2 digits | 14 |
| H | Hour, 24-hour clock, no leading zero | 14 |
| hh | Hour, 12-hour clock, 2 digits | 02 |
| h | Hour, 12-hour clock, no leading zero | 2 |
| mm | Minutes, 2 digits (in a time context) | 05 |
| ss | Seconds, 2 digits | 09 |
| SSS / fff | Milliseconds (fraction of a second, 3 digits) | 123 |
| A / tt / AA | AM/PM designator | PM |
| a | am/pm, lowercase in Moment and Day.js (Java and LDML print PM) | pm |
| gggg | Era name (Excel/Word; mainly for the Japanese calendar) | AD (Gregorian) |
The same handful of tokens combine into the patterns you see on forms, in spreadsheets and in system specifications. The patterns are written in the generic notation used on forms; the right-hand column notes where each one is typically found.
| Pattern | Output | Commonly used for |
|---|---|---|
| DDMMYYYY | 02102026 | Compact form fields, bank and government forms, reference numbers |
| DDMMYY | 021026 | Short form fields and legacy systems where space is tight |
| DD/MM/YYYY | 02/10/2026 | The everyday numeric format in the UK, Ireland, India, Australia, New Zealand, much of Europe and Latin America |
| DD-MM-YYYY | 02-10-2026 | Netherlands, India and other day-first locales; also common in file names |
| DD.MM.YYYY | 02.10.2026 | Germany, Switzerland, Austria, Russia, Poland, Czechia and other countries that use dots |
| DD MMM YYYY | 02 Oct 2026 | Documents, tickets and reports where the date must be unambiguous across countries |
| DD MMMM YYYY | 02 October 2026 | Formal documents and letters |
| D MMMM YYYY | 2 October 2026 | British and international prose, style guides, legal documents |
| DD-MON-YYYY | 02-OCT-2026 | Oracle Database (TO_CHAR(d, 'DD-MON-YYYY')); Oracle's long-standing default display is the similar DD-MON-RR |
| DDMMMYYYY | 02OCT2026 | SAS DATE9. format (month in capitals); clinical data, airline and banking records |
| MM/YYYY | 10/2026 | Month-level dates: CVs, statements, start and end dates |
| MM-YYYY | 10-2026 | Month-level dates in file names and reports |
| MM/YY | 10/26 | Payment card expiry dates |
| YYYYMMDD | 20261002 | ISO 8601 basic format; file names, database keys, EDI, batch files (sorts correctly as text) |
| YYYY-MM-DD | 2026-10-02 | ISO 8601 extended format; APIs, databases, HTML <input type="date">, and the safest choice for data exchange |
| YYMMDD | 261002 | Machine-readable passport zones (birth and expiry dates), compact log and batch identifiers |
| DD/MM/YYYY HH:MM | 02/10/2026 14:05 | Day-first date with 24-hour time; here the second MM follows HH, so it means minutes |
| MM/DD/YYYY hh:mm tt | 10/02/2026 02:05 PM | US date with 12-hour time (.NET notation; written hh:mm aa or hh:mm a in Java-style tools) |
| YYYYMMDDHHMMSS | 20261002140509 | Timestamps in file names, logs and message formats |
| yyMMddHHmmssfff | 261002140509123 | .NET/Java-style compact timestamp with milliseconds, often used in generated IDs |
A numeric pattern on its own never tells a reader whether 02/10/2026 is 2 October or 10 February. If you control the format, prefer ISO 8601 (YYYY-MM-DD) for data and a month name (D MMMM YYYY) for people. The DD/MM vs MM/DD guide covers which countries use which order.
The concept is the same everywhere; the letters are not. Each cell below shows the code that produces the value in the first column.
| Concept (example) | Excel | Word \@ |
strftime | PHP date() |
Java | .NET |
|---|---|---|---|---|---|---|
| 4-digit year (2026) | yyyy | yyyy | %Y | Y | yyyy / uuuu | yyyy |
| 2-digit year (26) | yy | yy | %y | y | yy / uu | yy |
| 2-digit month (10) | mm | MM | %m | m | MM | MM |
| Month, no zero (3 for March) | m | M | %-m | n | M | M |
| Abbreviated month (Oct) | mmm | MMM | %b | M | MMM | MMM |
| Full month (October) | mmmm | MMMM | %B | F | MMMM | MMMM |
| 2-digit day (02) | dd | dd | %d | d | dd | dd |
| Day, no zero (2) | d | d | %-d | j | d | d |
| Weekday, short (Fri) | ddd | ddd | %a | D | EEE | ddd |
| Weekday, full (Friday) | dddd | dddd | %A | l | EEEE | dddd |
| Hour, 24-hour (14) | hh (no AM/PM in format) | HH | %H | H | HH | HH |
| Hour, 12-hour (02) | hh + AM/PM | hh | %I | h | hh | hh |
| Minutes (05) | mm (after h or before s) | mm | %M | i | mm | mm |
| AM/PM (PM) | AM/PM | AM/PM | %p | A | a | tt |
| dd/mm/yyyy pattern | dd/mm/yyyy | dd/MM/yyyy | %d/%m/%Y | d/m/Y | dd/MM/yyyy | dd/MM/yyyy |
strftime covers C, Python (datetime.strftime), Ruby (Time#strftime), PHP's deprecated strftime() and the Unix date command. The no-padding flag %-d/%-m is a glibc/BSD extension that Python and Ruby pass through on Linux and macOS; on Windows the C runtime uses %#d instead. Excel codes are shown for English-language Excel; some localised versions use translated letters (German Excel, for example, uses TT.MM.JJJJ). In .NET, a lone d or M is read as a standard format string, so write %d when you need just the day number.
| Concept (example) | Moment / Day.js | date-fns / Unicode LDML | Oracle TO_CHAR |
MySQL DATE_FORMAT |
PostgreSQL to_char |
|---|---|---|---|---|---|
| 4-digit year (2026) | YYYY | yyyy | YYYY | %Y | YYYY |
| 2-digit year (26) | YY | yy | YY / RR | %y | YY |
| 2-digit month (10) | MM | MM | MM | %m | MM |
| Month, no zero (3 for March) | M | M | FMMM | %c | FMMM |
| Abbreviated month (Oct) | MMM | MMM | Mon (MON → OCT) | %b | Mon (MON → OCT) |
| Full month (October) | MMMM | MMMM | FMMonth | %M | FMMonth |
| 2-digit day (02) | DD | dd | DD | %d | DD |
| Day, no zero (2) | D | d | FMDD | %e | FMDD |
| Weekday, short (Fri) | ddd | EEE | Dy | %a | Dy |
| Weekday, full (Friday) | dddd | EEEE | FMDay | %W | FMDay |
| Hour, 24-hour (14) | HH | HH | HH24 | %H | HH24 |
| Hour, 12-hour (02) | hh | hh | HH12 / HH | %h / %I | HH12 / HH |
| Minutes (05) | mm | mm | MI | %i | MI |
| AM/PM (PM) | A (a → pm) | a | AM / PM | %p | AM / PM |
| dd/mm/yyyy pattern | DD/MM/YYYY | dd/MM/yyyy | DD/MM/YYYY | %d/%m/%Y | DD/MM/YYYY |
In Oracle and PostgreSQL, Month and Day are blank-padded to a fixed width (for example October ); the FM prefix removes the padding and leading zeros. Their case follows the code: MON gives OCT, Mon gives Oct. In MySQL, %M is the month name and %i is minutes, the opposite of what strftime users expect. In date-fns, DD and YYYY are day-of-year and week-numbering year, and are rejected unless you opt in, which is why its patterns use dd and yyyy.
In Microsoft Word, a date field's format comes from the \@ date-time picture switch. Press Alt+F9 to show field codes, edit the picture, then press F9 to update:
{ DATE \@ "dd/MM/yyyy" } → 02/10/2026
{ DATE \@ "dd.MM.yyyy" } → 02.10.2026
{ DATE \@ "d MMMM yyyy" } → 2 October 2026
{ TIME \@ "HH:mm" } → 14:05
{ CREATEDATE \@ "dddd, d MMMM yyyy h:mm am/pm" }
Word uses uppercase M for month and lowercase m for minutes, so \@ "dd/mm/yyyy" puts the minutes where the month should be. You can paste a whole field code into the pattern tester; it extracts the picture from \@ "…" automatically.
Two-digit day, two-digit month, four-digit year, with no separators. Each letter stands for one digit, so the result is always eight characters long. Forms that ask for DDMMYYYY usually want only digits; the separated versions are DD/MM/YYYY, DD-MM-YYYY and DD.MM.YYYY.
The only difference is the year: YY keeps the last two digits, YYYY keeps all four. Two-digit years force the reading system to guess the century, and different parsers use different cutoffs, so use DDMMYYYY whenever the field allows it. See date parsing pitfalls.
Three Ms give an abbreviated month name; four give the full name. Both are unambiguous to a human reader regardless of country, which is why they are used on tickets, contracts and international documents. Month names are language-dependent: MMM is Okt in German.
MON is Oracle's code for the abbreviated month name, printed in upper case when the code is upper case. DD-MON-YYYY is therefore the generic name for dates such as 02-OCT-2026. The closely related DDMMMYYYY (no hyphens) is the SAS DATE9. format, and "ddmmmyyyy" means the same thing.
In Java, .NET, LDML, date-fns, Moment and Word, MM is month and mm is minutes. Excel uses mm for both and decides by position: right after h/hh or right before ss it means minutes. On paper forms, DD/MM/YYYY HH:MM is understood by context. Writing dd/mm/yyyy in Java prints minutes in the middle.
In Java's DateTimeFormatter, Unicode LDML and date-fns, YYYY is the week-based year from the ISO 8601 week calendar (or the locale's week rules). It matches the calendar year most of the time, but not for a few days around New Year: 29 December 2025 falls in ISO week 1 of 2026, so YYYY prints 2026. Use yyyy (or uuuu) unless you also print the week number.
Short answers to the date pattern questions people search for most.
DDMMYYYY is a date pattern meaning a 2-digit day, a 2-digit month and a 4-digit year written together with no separators. 2 October 2026 is written 02102026. With separators it becomes DD/MM/YYYY (02/10/2026), DD-MM-YYYY or DD.MM.YYYY.
DDMMYYYY uses a 2-digit month number (02102026), while DDMMMYYYY uses a 3-letter month abbreviation (02OCT2026). The extra M switches the month from a number to a name. DDMMMYYYY is the output of the SAS DATE9. format and is common in clinical, airline and banking records because it cannot be confused between day-first and month-first readings.
DD MMM YYYY is a 2-digit day, a 3-letter month abbreviation and a 4-digit year separated by spaces, for example 02 Oct 2026. DD MMMM YYYY uses the full month name instead: 02 October 2026. D MMMM YYYY drops the leading zero from the day: 2 October 2026.
It depends on the system. In Java, .NET, Unicode LDML, date-fns, Moment and Word field codes, uppercase MM is month and lowercase mm is minutes. Excel uses m and mm for both and decides by position: immediately after an hour code or immediately before a seconds code it means minutes, otherwise month. In strftime, %m is month and %M is minutes; in MySQL, %i is minutes and %M is the month name.
hh:mm tt is a .NET custom format: hh is the hour on a 12-hour clock with a leading zero, mm is minutes and tt is the AM/PM designator. 14:05 is shown as 02:05 PM. Java, LDML and date-fns write the same thing as hh:mm a, and Moment and Day.js as hh:mm A.
%d/%m/%Y is a strftime pattern used by C, Python, Ruby and many other tools. %d is the 2-digit day, %m the 2-digit month and %Y the 4-digit year, so it produces 02/10/2026 for 2 October 2026. %y gives a 2-digit year, so %d-%m-%y produces 02-10-26.
In Excel and Word date formats, the g codes (g, gg, ggg, and the gggg seen in many templates) display the era name. They are mainly used with the Japanese calendar, where the year is counted within an imperial era such as Reiwa. In .NET custom format strings, g or gg shows the period or era, for example A.D. for the Gregorian calendar.
Add a date-time picture switch to the field, for example { DATE \@ "dd/MM/yyyy" } or { DATE \@ "dd.MM.yyyy" }. In Word field codes, uppercase M is month and lowercase m is minutes, so dd/mm/yyyy would insert minutes in the middle position. Press Alt+F9 to toggle field codes and F9 to update the field.