yyyyMMddHHmmss:
the 14-digit timestamp and letter case

yyyyMMddHHmmss writes a date and time as 14 digits, like 20260305143000: year, month, day, hour, minute, second. It is common in file names and logs. This page explains the letter case and shows how to produce it in Excel and code.

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

SymbolMeaningDigitsMarch 5, 2026 14:30:00
yyyyYear42026
MMMonth (01–12)203
ddDay (01–31)205
HHHour (00–23, 24-hour clock)214
mmMinute (00–59)230
ssSecond (00–59)200
yyyyMMddHHmmss20260305143000

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

FormatExampleUse
yyyyMMddHHmmss2026030514300014 digits, no separators; sorts by name = by time
yyyyMMdd_HHmmss20260305_143000An underscore between date and time for readability. Common in file names
yyyyMMddHHmmssSSS20260305143000123Adds milliseconds (SSS, 3 digits). Used in Java and similar
yyyy-MM-dd HH:mm:ss2026-03-05 14:30:00For 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

EnvironmentHowNotes
Excel=TEXT(NOW(),"yyyymmddhhmmss")mm next to h is read as minutes. The hour is 24-hour
Java / C#yyyyMMddHHmmssmm 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%SA different symbol set (strftime)
JavaScriptnew 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.