Developer

Unix Timestamp Converter (Epoch to Date)

Paste a timestamp and read the date, or pick a date and read the timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected by length, and you can override the guess if the number is unusual.

Right now

  • Seconds 0
  • Milliseconds 0

Timestamp to date

Commas, spaces and underscores are ignored.

    Date to timestamp

      What a Unix timestamp actually counts

      A Unix timestamp is a count of seconds since 1 January 1970 at 00:00:00 UTC, the moment everyone calls the epoch. There is nothing else in it. No time zone, no calendar rules, no locale — just a number on a line that stretches forwards and backwards from that instant.

      The part that catches people out is leap seconds. POSIX time defines every day as exactly 86,400 seconds, so the roughly two dozen leap seconds added to civil time since 1972 do not appear in the count. When one is inserted, a timestamp either repeats a value or skips, depending on how the system smears it. The upside is that converting a timestamp to a date is pure arithmetic with no lookup table. The cost is that a Unix timestamp cannot name a leap second at all.

      Seconds or milliseconds

      Unix tools, most SQL databases and a lot of APIs count whole seconds. JavaScript, Java and anything derived from them count milliseconds. Go and some tracing systems use nanoseconds. All of them are called "the timestamp" in documentation, which is how the bug gets in.

      Length is the quickest tell for any date near the present. Ten digits is seconds, thirteen is milliseconds, sixteen is microseconds, nineteen is nanoseconds. Those lengths are stable for a long time: a seconds timestamp stayed at ten digits from September 2001 and will until 2286.

      The failure mode is loud in one direction and quiet in the other. Feed milliseconds to something expecting seconds and you land tens of thousands of years in the future, which somebody will notice. Feed seconds to something expecting milliseconds and you land in January 1970 — a plausible-looking wrong answer that quietly sorts to the top of every list. If a date in your app shows 1970, you are off by a factor of 1000.

      The 2038 problem

      A signed 32-bit integer runs out at 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. One second later it wraps to a negative number and the date reads December 1901.

      Your laptop is not the worry. The 32-bit value survives in embedded firmware, in old C code that was never recompiled, in file formats, and in database columns: MySQL's TIMESTAMP type is still capped at that same 2038 instant, while DATETIME is not. If you store a mortgage end date or a certificate expiry in a 32-bit field, the bug is already in your data.

      A timestamp has no time zone

      This is worth saying twice, because it causes more incident reports than 2038 ever will. A timestamp identifies an instant. The time zone is applied when you display it, not when you store it. Two people reading the same timestamp in Tokyo and Lisbon see different wall clocks and neither is wrong.

      The classic mistake is going the other way: taking the digits off a local clock, calling mktime or its equivalent without the offset, and storing the result. That stores an instant that is off by the offset, and the error changes twice a year when daylight saving moves. If the value came from a user's calendar rather than from a clock, store the zone name alongside it — "09:00 in Europe/Madrid" and "an instant" are different facts.

      Where this converter stops

      Frequently asked questions

      What is the Unix epoch?

      Midnight UTC on 1 January 1970. It was chosen as a convenient recent round date when Unix timekeeping was designed, not for any deeper reason, and it stuck. Timestamps before it are negative.

      How do I know whether my timestamp is in seconds or milliseconds?

      Count the digits. For any date close to today, ten digits means seconds and thirteen means milliseconds. If a converted date lands in January 1970, you handed seconds to something that expected milliseconds.

      Can a Unix timestamp be negative?

      Yes — a negative value is that many seconds before 1970. This tool handles them, but plenty of software does not: unsigned columns, some date libraries and many APIs reject anything below zero, so pre-1970 dates are worth testing rather than assuming.

      Why does the same timestamp show a different time on my colleague’s screen?

      Because the local line is rendered in whatever zone the device is set to, and the timestamp itself carries none. Compare the ISO 8601 UTC line instead — that one is identical everywhere.

      What happens to timestamps in 2038?

      Signed 32-bit counters overflow on 19 January 2038 and wrap to 1901. Anything using 64-bit time is fine for longer than the universe is going to care, but 32-bit values still sit in firmware, old file formats and MySQL TIMESTAMP columns.

      Last updated September 19, 2026