CompoundPage

Unix Timestamp Converter

The Unix timestamp converter turns epoch time in seconds, milliseconds, microseconds or nanoseconds into a date in UTC and any time zone, and a date back into a timestamp. The unit is read from the size of the number.

Also the zone a date is read in when converting to a timestamp.

UTC2023-11-14T22:13:20Z

Read as Up to 11 digits is read as seconds, 12-14 as milliseconds, 15-17 as microseconds and 18 or more as nanoseconds. A millisecond timestamp from before March 1973 is short enough to pass for seconds.
seconds (10 digits)
UTC
Tuesday, November 14, 2023, 22:13:20 UTC
In EST Eastern Standard Time, UTC-05:00.
Tuesday, November 14, 2023, 17:13:20 EST
Is EST in force that day On 2023-11-14, New York is on EST.
yes
ISO 8601 (UTC)
2023-11-14T22:13:20Z
ISO 8601 (EST)
2023-11-14T17:13:20-05:00
RFC 2822
Tue, 14 Nov 2023 22:13:20 +0000
RFC 2822 (EST)
Tue, 14 Nov 2023 17:13:20 -0500
The same instant
1700000000 s, 1700000000000 ms, 1700000000000000 µs
32-bit (the 2038 problem) About 5,179 days before a signed 32-bit time_t overflows at 2,147,483,647 (2038-01-19 03:14:07 UTC).
fits; 447,483,647 seconds to spare
Landmark timestamps
TimestampUTCWhat it isRelative to this one
01970-01-01T00:00:00ZThe Unix epoch19,676 days earlier
10000000002001-09-09T01:46:40ZOne billion seconds8,102 days earlier
12345678902009-02-13T23:31:30Z12345678905,387 days earlier
20000000002033-05-18T03:33:20ZTwo billion seconds3,472 days later
21474836472038-01-19T03:14:07ZSigned 32-bit limit (the 2038 problem)5,179 days later
42949672952106-02-07T06:28:15ZUnsigned 32-bit limit30,034 days later

How the Unix Timestamp Converter works

A Unix timestamp is the number of seconds since 00:00:00 UTC on January 1, 1970, the Unix epoch. 1,700,000,000 is 22:13:20 UTC on November 14, 2023. It is the same number everywhere on earth at the same instant, which is the whole reason to use it: time zones and daylight saving are applied when the number is displayed, never when it is stored. A timestamp has no zone, and the date it shows depends on the zone it is read in, so the epoch converter gives UTC and a chosen zone side by side.

The commonest mistake is getting the unit wrong. Unix and C count seconds, but JavaScript and Java count milliseconds, Python's time.time_ns() and Go's UnixNano() return nanoseconds, and plenty of databases and logging systems store microseconds. The same instant is a 10-digit number in seconds, 13 digits in milliseconds, 16 in microseconds and 19 in nanoseconds. Read a millisecond value as seconds and the date lands more than 50,000 years out; read seconds as milliseconds and you get a date in January 1970.

The 2038 problem is the other thing worth knowing. Systems that store time as a signed 32-bit integer can count up to 2,147,483,647 seconds, which is 03:14:07 UTC on January 19, 2038. One second later the value wraps to -2,147,483,648, which such a system reads as 20:45:52 UTC on December 13, 1901. Most current operating systems and languages use a 64-bit time_t and are not affected, but embedded devices, old file formats and database columns declared as 32-bit integers still are. Unsigned 32-bit storage lasts until 06:28:15 UTC on February 7, 2106.

Unix time ignores leap seconds. Every day counts as exactly 86,400 seconds, so the difference between two timestamps can be a second or so short of the true elapsed time when a leap second falls between them. For anything other than precision timekeeping that is the right trade, and it is why converting a timestamp to a calendar date is pure arithmetic with no table.

ISO 8601 and RFC 2822 are the two formats most code needs. ISO 8601 (2023-11-14T22:13:20Z) is the sortable, unambiguous form used by JSON APIs, logs and databases; the Z means UTC, and an offset like -05:00 means the time is written in a zone five hours behind it. RFC 2822 (Tue, 14 Nov 2023 22:13:20 +0000) is the email-header format, also used by RSS feeds and many HTTP libraries.

A date converted to a timestamp is read in the selected zone. The zones are fixed offsets (EST is always UTC-5), and the result says whether that region was on standard or daylight time on the date, because a time written "EST" in July usually means New York local time, which is EDT.

Unix Timestamp Converter FAQ

What is the current Unix timestamp?

It goes up by one every second. In a terminal, date +%s prints the current value; in JavaScript it is Math.floor(Date.now() / 1000). 1700000000 was 22:13:20 UTC on November 14, 2023.

Is my timestamp in seconds or milliseconds?

Count the digits. A current timestamp is 10 digits in seconds, 13 in milliseconds, 16 in microseconds and 19 in nanoseconds.

What happens in 2038?

A signed 32-bit integer holding Unix time overflows after 2,147,483,647 seconds, which is 2038-01-19 03:14:07 UTC, and wraps to a date in December 1901. Systems using a 64-bit time_t, which is now the norm, are unaffected.

Can a Unix timestamp be negative?

Yes. Negative values are dates before 1970-01-01 00:00:00 UTC, so -86400 is 1969-12-31 00:00:00 UTC. Some systems reject them even though they are valid.

Does a Unix timestamp have a time zone?

No. It counts seconds from a fixed instant defined in UTC, so it is the same number everywhere at the same moment. The zone only matters when the number is turned into a date and time for display.

Related calculators

Embed this calculator
<div id="compoundpage-unix-timestamp-converter"></div>
<script src="https://compoundpage.com/embed/unix-timestamp-converter.js" async></script>

The same calculation as JSON