Date & Time Formatter

Format a date into ISO 8601, RFC 2822, 12/24-hour, Unix timestamps or your own token template with YYYY, MM, DD and hh, each with Copy.

Everything is computed locally in your browser. Nothing leaves your device.

Result
—
Common formats
Unix timestamps
Unix seconds
0
Unix milliseconds
0

How It Works

This formatter takes the date and time you pick, then rewrites it in any number of layouts using a small token grammar. Each token is a placeholder — YYYY is the 4-digit year, MM the zero-padded month, DD the zero-padded day, HH the 24-hour clock, mm minutes, ss seconds, SSS milliseconds, EEEE the full weekday name and DDDD the full month name. Anything that is not a token is copied verbatim, which lets you build layouts like YYYY-MM-DD, DD/MM/YYYY hh:mm or EEEE, DD MMM YYYY with plain punctuation.

Where the letters come from
Token names follow the conventions of most date libraries (moment.js, java.text.SimpleDateFormat and friends), so a template you build here usually drops straight into your code. Weekday and month names are resolved with the built-in Intl.DateTimeFormat API, so EEEE and DDDD always match the language your browser is set to.
12-hour vs 24-hour
HH prints the 24-hour clock (00–23), while hh prints the 12-hour clock (01–12). The optional a token adds the AM/PM marker. Both read from the same instant, so the two formats always agree.
Unix timestamps
A Unix timestamp is the number of seconds elapsed since 00:00:00 UTC on January 1, 1970. This tool shows both seconds and milliseconds for your selected date, and the reverse direction works too: type any number of seconds and the picker jumps to that moment. Millisecond values are exactly 1,000× the seconds value.
Why the formats list
ISO 8601 (YYYY-MM-DDThh:mm:ss) is the safest exchange format for machines, YYYY-MM-DD and MM/DD/YYYY cover the two dominant human date orders, RFC 2822 is what email headers and many APIs expect, and the 12/24-hour forms are for people. Each row has a Copy button so you never have to select text by hand.

Frequently Asked Questions

What do the template tokens mean?

Tokens are placeholders that get replaced with parts of the date. YYYY is the 4-digit year (2026), YY the 2-digit year, MM the zero-padded month (09), M the month number (9), DD the zero-padded day, D the day number, HH the 24-hour clock, hh the 12-hour clock, mm minutes, ss seconds, SSS milliseconds, EEEE the full weekday name, E the short weekday name, DDDD the full month name and MMM the short month name. Tokens are case-sensitive, so hh and HH are different.

How is RFC 2822 generated?

The tool builds the RFC 2822 string from the same local date you entered: short weekday, day, short month name, 4-digit year, 24-hour time with zero padding, and a UTC offset. It is the format used in email headers and many API date fields, so you can paste the result directly into code or mail headers.

How do I convert between Unix timestamps and dates?

Both directions work live. The date picker shows the current Unix seconds and milliseconds for the selected moment, and there is a separate field where you can type any Unix timestamp (seconds) to see the corresponding date. Millisecond timestamps are just the seconds value multiplied by 1,000.

Does this tool need an internet connection or store my data?

No. Everything is computed by JavaScript running in your browser tab using the built-in Intl.DateTimeFormat API. Nothing is uploaded, stored or transmitted — close the page and the inputs are gone.

Can I use this tool in my own project?

Yes — use it as a reference for the exact string format you need. The token syntax (YYYY, MM, DD, hh, EEEE, etc.) matches the conventions used by most date libraries, so a template built here can usually be dropped straight into a formatter in your code.