Date Format Converter

Convert between Unix timestamp, ISO 8601, RFC, MongoDB ObjectId, and more

Overview

Paste a Unix timestamp, an ISO 8601 or RFC 3339 string, an HTTP or RFC 2822 date, a written date or a MongoDB ObjectId, and the converter shows the same instant in every common format at once; click any row to copy it. The line under the field says how the value was read and in which time zone the result is shown. Everything runs in your browser; nothing you paste is sent anywhere.

What you can paste

You pasteExampleRead as
1 to 10 digits1700000000Unix seconds
11 to 13 digits1700000000123Unix milliseconds
14 to 16 digits1700000000123456Unix microseconds
17 to 19 digits1700000000123456789Unix nanoseconds
24 hex characters507f1f77bcf86cd799439011MongoDB ObjectId (the first 4 bytes are seconds)
ISO 8601 / RFC 33392026-06-09T05:21:10Z, 2026-06-09t052110z, 20260609T052110Z, 2026-06-09T05:21:10.123+09:00the date and time, with the offset it carries
RFC 2822 / HTTP dateTue, 09 Jun 2026 05:21:10 GMTthe date and time, with the zone it carries
Written dateJune 9, 2026 5:21 PM, 9 Jun 2026the date and time
Numeric date12/31/2022 11:59 PM, 31.12.2022month first unless the first number is above 12
Compact date20260609a date

Case does not matter, and the date separator can be -, /, . or 年月日. The time can use colons, spaces or no separator (13 06 54, 130654), and the offset can be Z, +09, +0900, +09:00 or a zone such as GMT, UTC, EST, PST or JST. Fractions of a second are kept to the millisecond.

An 8-digit number that is a real date between 1900 and 2100 (20260609) is read as that date, not as seconds in January 1970. A Unix value in seconds with 11 or more digits (after the year 2286) is read as milliseconds: paste an ISO date for those. Written dates need a four-digit year.

If the text cannot be read, the field shows what the tool understands and four examples you can click.

Local time or UTC

The Local / UTC switch decides how a time without an offset is read, and which zone the clock rows show. 2026-06-09 05:21:10 is 05:21:10 in your browser's time zone under Local and 05:21:10 UTC under UTC. A Unix value, an ObjectId and any text with an offset or zone name ignore the switch: they name one instant. The ISO 8601 row and the HTTP date row are always UTC.

If a time without an offset falls on a daylight-saving change (the repeated hour in autumn, the skipped hour in spring), your browser's own rule decides which instant is meant. Add an offset to remove the doubt.

When a numeric date such as 09/06/2026 fits both readings, it is read as month/day (6 September) and a button next to the status line switches it to day/month (9 June).

Share a result

The address of the page follows what you type: ?q= holds the text and ?tz=utc or ?tz=local the switch, so a copied link opens the same result and a reload keeps it. The clock value filled in when the page opens is not added to the address until you change it.

What each row shows

RowExampleNotes
Unix seconds1780982470whole seconds, rounded down
Unix milliseconds1780982470000what Date.now() returns
ISO 8601 (UTC)2026-06-09T05:21:10.000Zalways UTC, with milliseconds
RFC 33392026-06-09T14:21:10+09:00in the chosen zone: Z under UTC, the numeric offset under Local
RFC 2822Tue, 09 Jun 2026 14:21:10 +0900in the chosen zone, for email headers
HTTP date (GMT)Tue, 09 Jun 2026 05:21:10 GMTalways GMT, for Last-Modified and Expires
SQL (ISO 9075)2026-06-09 14:21:10.000in the chosen zone, for MySQL and PostgreSQL
Readablethe date in full, in the page languagein the chosen zone
Relative5 months agomeasured from now, in the page language
Excel serial46182.223032days since 1900, from the UTC instant
Mongo ObjectId6a27a2c600000000000000008 hex digits of seconds, then 16 zeros
Custom formatwhatever you type belowin the chosen zone

A click on a row copies only its value; Copy all copies every value, one per line.

Mongo ObjectId

The first 8 hex characters of an ObjectId are the creation time in seconds, so pasting a real ObjectId gives the document's creation time. The ObjectId row builds an ObjectId with that timestamp and zeros for the rest, which is useful as a range bound in a query. An ObjectId holds a 32-bit second count, so instants before 1970 or after 2106 show a dash.

Custom format

The custom format field accepts Day.js format tokens, up to 200 characters. It sits below the rows and follows the Local / UTC switch; empty the field to hide its row. Common ones:

  • YYYY four-digit year, YY two-digit; MM month (01-12), M without the leading zero; DD day, D without the leading zero
  • HH 24-hour, hh 12-hour with A for AM/PM; mm minutes; ss seconds; SSS milliseconds
  • X Unix seconds, x Unix milliseconds; Q quarter; Do day with an ordinal (9th)
  • [text] prints text as written

Mixing up MM (month) with mm (minutes), or HH with hh, is the most common reason a pattern gives unexpected output.