Short answer: yyyyMMddHHmmss = 4-digit year + 2-digit month, day, hour, minute and second, 14 digits in total. March 5, 2026 at 14:30:00 is 20260305143000. MM is the month, mm is minutes, HH is the 24-hour clock. Letter case changes the meaning.
What each letter means
| Symbol | Meaning | Digits | March 5, 2026 14:30:00 |
|---|---|---|---|
| yyyy | Year | 4 | 2026 |
| MM | Month (01–12) | 2 | 03 |
| dd | Day (01–31) | 2 | 05 |
| HH | Hour (00–23, 24-hour clock) | 2 | 14 |
| mm | Minute (00–59) | 2 | 30 |
| ss | Second (00–59) | 2 | 00 |
| yyyyMMddHHmmss | 20260305143000 |
HH vs hh, MM vs mm
- MM (upper case) = month, mm (lower case) = minutes: use MM in the date part and mm in the time part.
- HH (upper case) = 24-hour clock, hh (lower case) = 12-hour clock: writing 14:00 as "02" hides whether it is AM or PM. Use HH in file names and logs.
- Excel does not distinguish MM from mm: it treats mm next to h or s as minutes and otherwise as the month.
Common variants
| Format | Example | Use |
|---|---|---|
| yyyyMMddHHmmss | 20260305143000 | 14 digits, no separators; sorts by name = by time |
| yyyyMMdd_HHmmss | 20260305_143000 | An underscore between date and time for readability. Common in file names |
| yyyyMMddHHmmssSSS | 20260305143000123 | Adds milliseconds (SSS, 3 digits). Used in Java and similar |
| yyyy-MM-dd HH:mm:ss | 2026-03-05 14:30:00 | For people to read. The colon cannot be used in file names |
Putting a time in a file name
Windows file names cannot contain a colon (:) or a slash (/). Write "143000" instead of "14:30". Sorted by name, the files come out in time order. For the idea behind dates in file names, see Date at the start or end of a file name? and Standardizing file name dates in yyyyMMdd.
Produce yyyyMMddHHmmss in Excel and code
| Environment | How | Notes |
|---|---|---|
| Excel | =TEXT(NOW(),"yyyymmddhhmmss") | mm next to h is read as minutes. The hour is 24-hour |
| Java / C# | yyyyMMddHHmmss | mm is minutes, MM is the month, hh is 12-hour. In Java, YYYY is the week-based year and breaks around New Year |
| Python | %Y%m%d%H%M%S | A different symbol set (strftime) |
| JavaScript | new Date().toISOString().replace(/[-:T]/g,"").slice(0,14) | Output is in UTC, which differs from Japan time by 9 hours |
Mind the time zone
A timestamp should say which time zone it uses. Decide with your team whether file names use local time or UTC. Some programs output UTC by default.
For the date-only 8 digits see What is yyyymmdd?; for the international standard see What is ISO 8601?
Type the timestamp with one key
Typing a timestamp by hand invites slips like "20260305143060". InsertDate is a Windows app that types today's date in your chosen format when you press the Insert key. See the supported formats in the download section.
Frequently Asked Questions
What is yyyyMMddHHmmss?
A 14-digit date and time: 4-digit year, then month, day, hour, minute and second in 2 digits each. March 5, 2026 at 14:30:00 is 20260305143000.
What is the difference between HH and hh?
HH is the 24-hour clock (00–23); hh is the 12-hour clock (01–12). Use HH in file names and logs, where AM/PM would be ambiguous.
What is the difference between MM and mm?
MM (upper case) is the month and mm (lower case) is minutes. Use MM in the date part and mm in the time part.
How do I put a time in a file name?
A colon cannot be used, so write the time without separators, like 143000. An underscore between date and time, as in 20260305_143000, is also common.
Try InsertDate Free for 7 Days
Press Insert. Get today's date in yyyyMMdd. Works in almost any Windows app, including Excel, Word and Notepad, with no configuration. To type into an app running as administrator, run InsertDate as administrator too.
InsertDate is a Windows 10/11 app. Reading on a phone? Open this page on your PC to install it.