Unix timestamp converter

Convert Unix timestamps in seconds or milliseconds to readable dates, or convert a date back to Unix time. See UTC and local time together.

What a Unix timestamp is

A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch. The number contains no time zone: at any given instant it is the same everywhere on Earth. That makes it convenient for logs, databases and APIs, which can store one number and leave the display in local time to each reader. The timestamp 1704067200, for example, is midnight UTC at the start of 1 January 2024.

Seconds or milliseconds?

Timestamps for present-day dates have 10 digits in seconds and 13 digits in milliseconds. JavaScript’s Date.now() and Java’s System.currentTimeMillis() return milliseconds; PHP’s time(), the date +%s command and most databases work in seconds. Mixing the two up is the most common timestamp bug. A millisecond value read as seconds lands tens of thousands of years in the future, and a seconds value read as milliseconds lands in January 1970. This converter therefore asks you to choose the unit instead of guessing from the length of the number.

Leap seconds, negative numbers and the year 2038

Unix time treats every day as exactly 86,400 seconds. The 27 leap seconds added to UTC between 1972 and 2016 are not counted, so a timestamp is a label for a moment on the calendar and not a precise count of elapsed seconds. Moments before 1970 are negative: -86400 is 31 December 1969. Systems that store the value as a signed 32-bit integer run out at 03:14:07 UTC on 19 January 2038; 64-bit systems do not have that limit. The 2038 boundary explains what is affected.

Landmark timestamps

Timestamp (seconds) Date and time (UTC) What it marks
0 1970-01-01 00:00:00 The Unix epoch, where counting starts
1000000000 2001-09-09 01:46:40 One billion seconds, the first 10-digit value
1234567890 2009-02-13 23:31:30 The digits 1 to 9 and 0 in order, celebrated by programmers at the time
2000000000 2033-05-18 03:33:20 Two billion seconds
2147483647 2038-01-19 03:14:07 The largest value a signed 32-bit integer can hold

Get the current timestamp in seconds

JavaScript Math.floor(Date.now() / 1000)
Python int(time.time())
PHP time()
Bash date +%s
PostgreSQL SELECT EXTRACT(EPOCH FROM now())::bigint
MySQL SELECT UNIX_TIMESTAMP()

Questions and answers

Is a Unix timestamp in UTC?

It is counted from a moment defined in UTC, and the number itself has no time zone. To read it you pick a zone for display. The converter shows the result in UTC and in your device’s local time side by side, so you can see both at once.

Why does my timestamp convert to 1970?

Either the value is in seconds and was read as milliseconds, or it is zero or empty where a real time was expected. Switch the unit to seconds and convert again. A date far in the future points to the opposite mistake.

What does the Z at the end of the result mean?

The result uses the ISO 8601 format, for example 2024-01-01T00:00:00.000Z. The T separates the date from the time, and the Z states that the time is in UTC. A date is not an instant explains why that marker matters.

Which range of dates can be converted?

Timestamps up to 100 million days on either side of the epoch, which is the limit of JavaScript dates. When you convert a date into a timestamp, the date field accepts years from 0001 to 9999.

Calculations run in your browser. No account is needed, and your inputs are not sent to our server. Read how our clocks work.

Related articles

Search cities and tools

Type to explore · Esc to close