Unix Timestamp Converter

See the current Unix time ticking live, convert any timestamp to a readable date (the unit is detected automatically) or turn a date into a timestamp.

What a Unix timestamp is

A Unix timestamp (also called epoch time or POSIX time) counts the seconds that have passed since the Unix epoch, 00:00:00 UTC on 1 January 1970. It is a single number that means the same instant everywhere on Earth, which is why databases, log files, APIs and programming languages use it to store time. Time zones and daylight saving only come into play when the number is turned back into a local date for display.

Timestamps before 1970 are negative: −86400 is 31 December 1969. Unix time ignores leap seconds — every day is treated as exactly 86,400 seconds — so it can be converted to a calendar date with simple arithmetic.

Seconds, milliseconds and microseconds

Different systems count in different units, which is the most common source of conversion errors:

Digits (today)UnitTypical source
10secondsUnix/Linux, PHP time(), Python time.time() (integer part), most APIs
13millisecondsJavaScript Date.now(), Java System.currentTimeMillis()
16microsecondsPostgreSQL, Python datetime internals
19nanosecondsGo time.UnixNano(), some logging systems

In Auto-detect mode the calculator guesses the unit from the size of the number: below 1011 it is treated as seconds (covering dates up to the year 5138), below 1014 as milliseconds, below 1017 as microseconds, and anything larger as nanoseconds. If the date you get is absurd — the year 1970 or 50,000 — choose the unit manually.

date = 1970-01-01T00:00:00Z + timestamp seconds

Worked examples

Timestamp → date (the default): 1700000000 has ten digits, so it is seconds. 1,700,000,000 ÷ 86,400 = 19,675 whole days plus 80,000 seconds (22 h 13 min 20 s). Day 19,675 after 1 January 1970 is 14 November 2023, so the timestamp is 2023-11-14T22:13:20Z — Tuesday 14 November 2023, 22:13:20 UTC, or 06:13:20 the next morning in Beijing (UTC+8).

Date → timestamp (the default): 1 January 2000, 00:00:00 UTC is 30 years after the epoch, including 7 leap days (1972 … 1996): (30 × 365 + 7) × 86,400 = 946,684,800.

The results are shown in several standard text formats: ISO 8601 (2023-11-14T22:13:20Z), used by JSON APIs and HTML, and RFC 2822 (Tue, 14 Nov 2023 22:13:20 +0000), used in email headers and HTTP.

The year 2038 problem and other pitfalls

  • Year 2038: systems that store Unix time in a signed 32-bit integer overflow at 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. Modern systems use 64-bit time, which lasts for billions of years.
  • Local vs UTC: the same timestamp shows a different clock time in each time zone. When converting a date to a timestamp, make sure you choose whether the date is UTC or your local time. To compare clock times across cities use the time zone converter.
  • Leap seconds: they are not counted, so subtracting two timestamps can be off by a few seconds from true elapsed atomic time — irrelevant for almost all applications.

Frequently asked questions

How do I tell if a timestamp is in seconds or milliseconds?

Count the digits. Current timestamps have 10 digits in seconds and 13 in milliseconds. Auto-detect does this for you.

Is a Unix timestamp affected by time zones?

No. The number is always counted from midnight UTC on 1 January 1970. Only the human-readable date you display depends on the time zone.

What happens on 19 January 2038?

Software still using signed 32-bit time will overflow and jump to December 1901. Systems with 64-bit time, which is now standard, are unaffected.

How do I get the current timestamp in code?

JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). PHP: time(). Linux shell: date +%s.

Last reviewed: