Skip to content

Unix Timestamp Converter

Convert a Unix timestamp to a date and a date to a timestamp, in seconds, milliseconds, microseconds or nanoseconds. The unit is detected from the digits, every time zone is available, and daylight saving gaps and overlaps are reported instead of guessed.

Runs locally in your browser

Current time

Seconds now
—
Milliseconds now
—

Timestamp to date

Seconds, milliseconds, microseconds or nanoseconds since 1970-01-01T00:00:00Z; a sign, decimals and 1.7e9 work.

Unit
—
ISO 8601 (UTC)
—
Local time
—
RFC 2822
—
HTTP-date
—
English
—
Relative
—
Seconds
—
Milliseconds
—
Microseconds
—
Nanoseconds
—

Date to timestamp

ISO 8601, like 2024-02-29 or 2024-02-29T12:00:00+03:00; without Z or an offset it is read in the time zone above.

Read as
—
Seconds
—
Milliseconds
—
Microseconds
—
Nanoseconds
—
ISO 8601 (UTC)
—

What the Unix timestamp converter does

A Unix timestamp counts the time since 1970-01-01T00:00:00Z, the Unix epoch. The converter turns a timestamp into its date in every common form, and a date into its timestamp, in seconds, milliseconds, microseconds or nanoseconds. It works out the unit from the number of digits, keeps every digit you give it, shows the date in any time zone, and tells you when a local time falls into a daylight saving change instead of quietly picking one. It parses dates by its own strict rules, so the result is the same in every browser.

How to convert a timestamp

  1. Paste a timestamp into Timestamp to date, such as 1700000000 from a log or 1700000000123 from JavaScript. The Unit line says how it was read.
  2. Choose a Time zone to see the date there as well; Local is your browser's zone.
  3. To go the other way, type a date into Date to timestamp, like 2024-02-29T12:00:00+03:00. Without Z or an offset, it is read in the chosen time zone.
  4. Copy any value with the button beside it. Current time shows the timestamp now, in seconds and milliseconds.

Examples

New Year in UTC is still New Year's Eve in New York

Input

1735689600

Output

Unit: seconds (10 digits)
ISO 8601 (UTC): 2025-01-01T00:00:00Z
America/New_York: 2024-12-31T19:00:00-05:00
RFC 2822: Wed, 01 Jan 2025 00:00:00 +0000
HTTP-date: Wed, 01 Jan 2025 00:00:00 GMT
Milliseconds: 1735689600000
A time that the clocks skip in spring

Input

2026-03-08T02:30

Output

Read as: 2026-03-08T03:30:00-04:00 (America/New_York)
Seconds: 1772955000
Milliseconds: 1772955000000
ISO 8601 (UTC): 2026-03-08T07:30:00Z
February 29 in a year that is not a leap year

Input

2025-02-29T10:00:00Z

Problem reported

February 2025 has 28 days. Write it like 2024-02-29, 2024-02-29T12:00 or 2024-02-29T12:00:00.5+03:00. (TIME_INVALID_DATE)

Timestamps often arrive inside JSON, as an exp claim or a created_at field. The JSON Formatter lays out such a response so you can find them, and the JSON Viewer copies a value with its path.

Seconds, milliseconds, microseconds and nanoseconds

Unix time itself is in seconds, but programs count in different units. date +%s, PHP's time(), C's time_t and most APIs use seconds; Python's time.time() adds a fraction. JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds. Go offers all four through Unix(), UnixMilli(), UnixMicro() and UnixNano(), Python's time.time_ns() and InfluxDB use nanoseconds, and PostgreSQL stores timestamps to the microsecond.

From September 2001 to November 2286, a timestamp in seconds has 10 digits, in milliseconds 13, in microseconds 16 and in nanoseconds 19. That is how Unit: Auto tells them apart: up to 11 digits it reads seconds, up to 14 milliseconds, up to 17 microseconds, and nanoseconds above. A value below 100,000,000 is the one real doubt, since it could be seconds before 1973 or milliseconds on the first day of 1970, so the converter reads it as seconds and shows the other reading.

The digits are never rounded: a nanosecond timestamp keeps all nine of its fraction digits, which a JavaScript number cannot hold, and the values in the other units are the same number with the decimal point moved.

Time zones and daylight saving time

A timestamp names the same moment everywhere; a time zone only changes how that moment is written. 1700000000 is 22:13 in UTC and 01:13 the next day in Istanbul. An offset like +03:00 describes one moment, while a zone name from the IANA time zone database (opens in a new tab), like Europe/Berlin, carries the zone's whole history: its daylight saving rules and every change of its offset. Some zones are not whole hours from UTC: Nepal is at +05:45, the Chatham Islands at +12:45, and Lord Howe Island moves its clocks by 30 minutes.

Daylight saving time makes some local times ambiguous. When the clocks go forward, an hour of local time never happens: in Berlin, 02:30 does not exist on the last Sunday of March. The converter then moves the time forward by the jump and says so. When the clocks go back, an hour happens twice: 02:30 on the last Sunday of October is first at +02:00, then at +01:00. The converter uses the earlier one and shows the later one too. A date with Z or an offset is never ambiguous, because it names its moment.

ISO 8601, RFC 2822 and HTTP dates

RFC 3339 (opens in a new tab), the internet's profile of ISO 8601, writes 2024-02-29T09:00:00Z: the parts from largest to smallest, so the text sorts in time order, with Z or an offset at the end. It is the form for JSON, logs and APIs. Email headers use the older form of RFC 5322 (opens in a new tab), which replaced RFC 2822: Thu, 29 Feb 2024 09:00:00 +0000. HTTP's Date, Last-Modified and Expires headers use its fixed variant, the IMF-fixdate of RFC 9110 (opens in a new tab), always in GMT.

The converter reads only ISO 8601 dates, and checks each part: a month has the days it has, hours go to 23 and seconds to 59. JavaScript's own Date is less strict. It reads 2024-02-29 as midnight UTC but 2024-02-29T00:00 as local midnight, and some browsers roll 2023-02-30 over into March. Here both forms are read in the chosen time zone, and a day that does not exist is an error.

The year 2038 problem

Many systems store Unix time as a signed 32-bit integer, the classic time_t. Its largest value, 2147483647, is 2038-01-19T03:14:07Z. One second later the number wraps around to its smallest value, which reads as 1901-12-13T20:45:52Z. 64-bit systems use a 64-bit time_t, and Linux has offered one on 32-bit machines since 2020, but old embedded devices, file formats and database columns still carry 32-bit fields: MySQL's TIMESTAMP type, for one, ends at that same second. The converter notes when a time falls outside the 32-bit range, so you can check whether the system that stores it will cope.

Dates before 1970

Negative timestamps count back from the epoch: -1 is 1969-12-31T23:59:59Z, and the first Moon landing, 1969-07-20T20:17:40Z, is -14182940. Decimals round down, toward the past, as they do for positive values: -1.5 is 1969-12-31T23:59:58.500Z, half a second before -1, not after it. A JavaScript Date reaches back to the year -271821, but not every system accepts negative values: MySQL's TIMESTAMP starts at 1970-01-01 00:00:01 UTC.

Options

Options
OptionValuesDefaultWhen to change it
UnitAuto, Seconds, Milliseconds, Microseconds, NanosecondsAutoAuto reads the unit from the digits. Choose one when a small value counts milliseconds, or when the source documents its unit.
Time zoneLocal, UTCLocalWhere a timestamp's date is also shown, and where a date without an offset is read. Every IANA zone your browser knows is in the list.

Common errors and fixes

Common errors and how to fix them
CodeWhat it meansHow to fix it
TIME_NOT_A_NUMBERErrorThe timestamp holds something other than a number: thousands separators, a decimal comma, a unit such as ms, or a date.Leave digits, a sign, a point and an exponent; a date goes into Date to timestamp.
TIME_OUT_OF_RANGEErrorThe value lies beyond what a JavaScript Date holds, 100 million days either side of 1970: usually extra digits or the wrong unit.Check the digits, and the Unit if you chose one.
TIME_AMBIGUOUS_UNITWarningA value below 100,000,000 is a time before 1973 in seconds, or one on the first day of 1970 in milliseconds.Choose the unit under Unit if it is not seconds.
TIME_INVALID_DATEErrorThe date is not in ISO 8601 form, or names a day, hour or second that does not exist, such as February 30, 24:00 or 23:59:60.Follow the message: it marks the part and gives the rule.
TIME_DST_GAPWarningThe local time falls in the hour that the clocks skip when daylight saving time starts.Nothing breaks: the time was moved forward by the jump. Give an offset to name the exact moment.
TIME_DST_OVERLAPWarningThe local time happens twice, because the clocks go back when daylight saving time ends.The earlier moment is used; give the later one's offset to choose it.
TIME_32BIT_OVERFLOWNoteThe time lies outside 1901-12-13T20:45:52Z to 2038-01-19T03:14:07Z, the range of a signed 32-bit time_t.Nothing to fix here; make sure the system that keeps the value stores 64-bit time.

Privacy

Unix Timestamp Converter runs entirely in your browser. What you type, paste or open is processed on your device: it is not sent to Toolzami, and Toolzami does not store it. Only the options you choose are remembered, in this browser.

Frequently asked questions

How do I get the current Unix timestamp in code?

In a shell, date +%s prints seconds. JavaScript's Date.now() gives milliseconds, so divide by 1000 and round down for seconds. Python's time.time() gives seconds with a fraction; int() drops it. In PostgreSQL, extract(epoch from now()) returns seconds.

Does Unix time count leap seconds?

No. Unix time treats every day as exactly 86,400 seconds, so a leap second has no number of its own: systems repeat a second or spread it over the day. This tool does the same and does not read 23:59:60.

Last updated