Date Formatter

Formats, date diff, countdown and lunar in one place

Date Input

Common Formats

Custom Template

Tokens: YYYY year YY 2-digit year MM month DD day HH (24-hour) hh (12-hour) mm minute ss second SSS ms ddd short weekday dddd full weekday A AM/PM Z offset (+08:00) DDD day of year w ISO week

Date Difference

to
Days
Hours
Minutes
Seconds

Add / Subtract

plus

Countdown

Days
Hours
Minutes
Seconds

Lunar Calendar (Solar → Lunar)

How to Use

Every system wants dates in its own format: databases store 2026-10-13, APIs want ISO 8601 (2026-10-13T08:00:00+08:00), logs use RFC 1123, UIs show long localized strings, and debugging calls for Unix seconds or milliseconds. Enter a date once here and get a dozen common formats instantly — click any row to copy it. The custom template supports YYYY, MM, DD, HH, mm, ss, SSS, dddd, Z, DDD, w and more for special layouts.

Beyond formatting, the tool includes date difference (total days/hours/minutes/seconds plus a compound sentence), date add/subtract with end-of-month clamping for months and years, a live countdown refreshing every second, and solar-to-lunar conversion for 1900-2100 with leap months, Ganzhi year and zodiac. Everything runs locally in your browser — no data is uploaded.

FAQ

Which placeholders does the custom template support?

YYYY four-digit year, YY two-digit year, MM/M month, DD/D day, HH 24-hour, hh 12-hour, mm/m minute, ss/s second, SSS milliseconds, ddd/dddd short and full weekday, A for AM/PM, Z for timezone offset (e.g. +08:00), DDD for day of year, and w for ISO week number. E.g. 'MM/DD/YYYY dddd' outputs 10/13/2026 Tuesday.

What do T and Z mean in ISO 8601?

T separates date from time; Z denotes zero offset (UTC), equivalent to +00:00. So 2026-10-13T00:00:00Z is midnight UTC, which is 08:00 in Beijing time.

What range does the lunar conversion support, and how accurate is it?

Solar-to-lunar conversion covers 1900-2100 and is computed from a built-in classic lunar data table that encodes each year's long/short months and leap month, producing the lunar month and day, Ganzhi year (e.g. Bing-Wu) and zodiac. Dates outside the range show 'Supports 1900-2100 only'. Everything is calculated offline in your browser.