Unix timestamp converter

Paste a Unix timestamp to see the date in UTC and your time zone, or pick a date to get its timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically.

Current Unix time (seconds)
–

Timestamp to date

UTC
–
Your time zone ()
–
ISO 8601
–
Relative
–

Date to timestamp

The date is in
Seconds
–
Milliseconds
–

How to use the Unix timestamp converter

  1. To read a timestamp, paste it into Unix timestamp, or click Use current time. The note beside the button says which unit it was read as.
  2. If the guess is wrong, change Unit from Detect automatically to seconds, milliseconds, microseconds or nanoseconds.
  3. Read the result as UTC, in Your time zone, as an ISO 8601 string, and as a Relative time such as “2 years ago”.
  4. To go the other way, pick a Date and time, under The date is in choose My time zone or UTC, and copy the Seconds or Milliseconds value.

What is a Unix timestamp?

A Unix timestamp (epoch time) is the number of seconds since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is the same everywhere in the world at a given moment, which is why systems store time this way and convert to a local time zone only for display.

Because it is just a number, a timestamp is easy to sort, compare and subtract: the gap between two timestamps in seconds is the elapsed time, with no time zones or daylight saving to worry about. Every Unix day is treated as exactly 86,400 seconds, so a leap second is not counted as an extra second.

Seconds, milliseconds or more?

Digits (today)UnitUsed by
10SecondsUnix, PHP time(), Python time.time() (as a float), JWT
13MillisecondsJavaScript Date.now(), Java System.currentTimeMillis()
16MicrosecondsPython time.time_ns() // 1000, some databases and logging systems
19NanosecondsGo UnixNano(), InfluxDB

With Detect automatically, the converter reads values from 100 billion upward as milliseconds, from 100 trillion as microseconds and from 100 quadrillion as nanoseconds; anything smaller is seconds. Negative values and fractional seconds such as 1700000000.5 are accepted.

Worked example

Enter 1700000000. It is read as seconds and shows:

Now enter 1700000000000. The extra three digits make it milliseconds, and it resolves to exactly the same moment. Going the other way, 1 January 2025 00:00:00 with UTC selected gives 1735689600 seconds and 1735689600000 milliseconds.

UTC versus local time

A timestamp has no time zone; it marks one instant. Time zones only appear when you turn it into a calendar date. Store and transmit timestamps or UTC, and convert to the viewer's zone at the last step. When you enter a date to convert, The date is in matters: 09:00 in London and 09:00 UTC are the same instant in winter but an hour apart in summer.

ISO 8601 dates

ISO 8601 writes a date and time from largest to smallest unit, so strings sort correctly as text: 2023-11-14T22:13:20Z. The trailing Z means UTC; an offset such as 2023-11-14T17:13:20-05:00 describes the same moment in New York. Prefer one of these forms in APIs and logs over a local format like 14/11/2023, which is read differently in the US and Europe.

Get the current timestamp in code

JavaScript   Math.floor(Date.now() / 1000)
Python       int(time.time())
Bash         date +%s
PHP          time()
Go           time.Now().Unix()
SQL (PG)     extract(epoch from now())

The year 2038 problem

Systems that store timestamps as signed 32-bit integers overflow at 03:14:07 UTC on 19 January 2038 (2147483647). Modern systems use 64-bit values.

One second later, a signed 32-bit counter wraps to −2147483648, which is 20:45:52 UTC on 13 December 1901. Embedded devices, old file formats and database columns declared as 32-bit integers are the usual places this still lurks. An unsigned 32-bit value lasts until 7 February 2106; a signed 64-bit value lasts for billions of years.

Common mistakes

Edge cases

Very old millisecond timestamps can fool automatic detection: anything before 3 March 1973 has 11 digits or fewer in milliseconds and is read as seconds. Choose Milliseconds in Unit when you know the source. Timestamps beyond about the year 275,760 are outside the range JavaScript dates can show and produce no result.

Key terms

Unix timestamp
The number of seconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. Also called epoch time or POSIX time. Many systems use milliseconds instead, giving a number 1,000 times larger for the same moment.
Epoch
The fixed starting point from which a system counts time. The Unix epoch is 00:00:00 UTC on 1 January 1970; other systems use different epochs, such as 1 January 1601 for Windows file times and 15 October 1582 for version 1 UUIDs.
UTC
Coordinated Universal Time, the world's reference time standard. It has no daylight saving and every time zone is defined as an offset from it, so servers, logs and APIs usually store and exchange times in UTC and convert only for display.
ISO 8601
The international standard for writing dates and times, such as 2023-11-14T22:13:20Z. Units run from largest to smallest so strings sort correctly as text, and a Z or an offset like -05:00 states the time zone unambiguously.
UTC offset
The difference between a local time and UTC, written as +01:00 or -05:00. A time zone's offset can change during the year because of daylight saving, so an offset alone does not identify a time zone.
Time zone
A region that shares the same rules for local time, named in the IANA database as Area/City, such as Europe/London or America/New_York. A zone records its UTC offset and daylight saving changes, past and present.
Leap second
A one-second adjustment occasionally added to UTC to keep it close to the Earth's rotation. Unix time ignores leap seconds and treats every day as 86,400 seconds; the practice of adding them is due to be phased out by 2035.
Year 2038 problem
The overflow of signed 32-bit Unix timestamps at 03:14:07 UTC on 19 January 2038, after which the value wraps to a negative number read as 1901. Systems that store time in 64-bit integers are not affected.

Frequently asked questions

How do I convert epoch to a date?
Paste the number in the timestamp box. The date appears in UTC and in your time zone. The unit is detected from the number of digits.
Is a Unix timestamp in UTC?
Yes. A timestamp is a single moment, counted from 1 January 1970 UTC. Time zones only matter when you display it.
Why is my date in 1970?
A timestamp in seconds was read as milliseconds, so it lands in January 1970. Set the unit to Seconds, or multiply by 1,000 in your code.
Can timestamps be negative?
Yes. Negative values are dates before 1 January 1970: -86400 is 31 December 1969 at 00:00 UTC. Some older systems and databases reject negative timestamps, so check before storing historical dates this way.
How do I tell if a timestamp is in seconds or milliseconds?
Count the digits. Current dates are 10 digits in seconds and 13 in milliseconds; microseconds have 16 and nanoseconds 19. If converting gives a date in January 1970, you used seconds where milliseconds were expected. If it gives a year far in the future, it was the other way round.
What is the year 2038 problem?
Software that stores Unix time in a signed 32-bit integer can only count up to 2,147,483,647 seconds, reached at 03:14:07 UTC on 19 January 2038. The next second wraps to a negative number, read as December 1901. Using 64-bit integers, now the default in modern operating systems and languages, fixes it.
Do Unix timestamps include leap seconds?
No. Unix time treats every day as exactly 86,400 seconds and ignores leap seconds, so it is not a perfect count of elapsed SI seconds. When a leap second occurs, systems either repeat a second or smear the adjustment over several hours. For everyday dates the difference does not matter.
How do I get the current Unix timestamp?
The live counter at the top of this page shows the current Unix time in seconds, with a Copy button. In code, use date +%s in a shell, Math.floor(Date.now() / 1000) in JavaScript, or int(time.time()) in Python.