Tools

Unix Timestamp Converter

Epoch time to dates and back, in any time zone

Unix time now (seconds)
–
Milliseconds
–
ISO 8601 (UTC)
–
Timestamp → date
Date → timestamp

How to convert a Unix timestamp

  1. The current Unix time is shown at the top in seconds and milliseconds and updates every second. Tap Copy to grab it.
  2. To turn a timestamp into a date, paste it into Timestamp → date. The unit is detected from the number of digits: 10 digits are seconds, 13 are milliseconds, 16 microseconds and 19 nanoseconds.
  3. You get the date in your local time zone and UTC, plus ISO 8601, RFC 2822, a relative description such as "3 days ago" and the day of the year.
  4. To go the other way, pick a date, time and time zone in Date → timestamp, or type any ISO 8601 or RFC 2822 date string.

What is Unix time?

Unix time (also called epoch time or POSIX time) counts the seconds since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. Because it is a single number with no time zone, it is the standard way to store and compare moments in databases, logs, APIs and file systems. JavaScript, Java and many APIs use milliseconds instead, so a timestamp 1,000 times too large is a common bug.

Signed 32-bit timestamps run out on 19 January 2038 (the "Year 2038 problem"). Modern systems use 64-bit values that last for billions of years.

Time zone conversions use your browser's built-in time zone database, so daylight saving time is applied correctly for any date and any IANA zone such as Europe/Paris or America/Los_Angeles.

How do I get the current timestamp in code?

JavaScript: Math.floor(Date.now() / 1000). Python: int(time.time()). PHP: time(). Bash: date +%s. SQL (PostgreSQL): extract(epoch from now()).

Why is my date in 1970?

You probably treated a seconds timestamp as milliseconds. Multiply by 1,000, or let the auto-detect here pick the unit.

Is Unix time the same in every time zone?

Yes. A Unix timestamp identifies the same instant worldwide. Only its display as a local date and time depends on the time zone.