Unix Timestamp Converter

Convert Unix timestamps (epoch seconds or milliseconds) to readable dates in your time zone and UTC, and convert dates back to timestamps.

Current Unix time 0

Timestamp → date

Date → timestamp

How to convert a Unix timestamp

  • Timestamp → date: paste a timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically from the number of digits, and the date is shown in your own time zone, in UTC and in ISO 8601 format.
  • Date → timestamp: pick a date and time, choose whether it is your local time or UTC, and copy the timestamp in seconds or milliseconds.

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, not counting leap seconds. Because it is a single number that is the same everywhere on Earth, it is used by databases, servers, programming languages and APIs to store moments in time without time zone confusion.

Getting the current timestamp in code

  • JavaScript: Math.floor(Date.now() / 1000)
  • Python: int(time.time())
  • PHP: time()
  • Java: Instant.now().getEpochSecond()
  • Linux / macOS shell: date +%s
  • SQL (PostgreSQL): EXTRACT(EPOCH FROM now())

FAQ

What is the year 2038 problem?

Systems that store Unix time as a signed 32-bit integer can only count up to 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. After that the number overflows. Modern systems use 64-bit timestamps, which last for billions of years.

Why is my timestamp 13 digits long?

It is in milliseconds, which JavaScript and Java use by default. Divide by 1,000 to get seconds.