Skip to content
HexSlate

Timestamp / Epoch Converter

From epoch

Seconds, milliseconds, microseconds or nanoseconds. The unit is detected automatically.

Nothing to convert yet

Type a Unix epoch value above.

From date

Nothing to convert yet

Pick a date and time above.

tz: UTCupdates every second

How the unit is detected, and where that breaks down

Nothing tags a bare number with its unit, so the guess comes from magnitude: ten digits is seconds, thirteen is milliseconds, each band 1000× the last. That is unambiguous for real dates from 2001 to past 2286.

The boundary is not. A number of 11 or 12 digits reads as seconds centuries from now or as milliseconds shortly after 1970, and both are valid readings of the same digits. No heuristic recovers the intent, so the split is fixed at 100,000,000,000: 11 digits is read as seconds, 12 digits as milliseconds.

The year 2038 problem

On 2038-01-19 at 03:14:08 UTC, epoch seconds exceed 2,147,483,647, the largest value a 32-bit signed integer holds. Systems storing time in that type wrap to a negative number and land in December 1901: still a live bug in older C code, embedded firmware and databases with a 32-bit time column. Not a JavaScript problem, since Date uses a 64-bit float, so whichever system produced your timestamp decides whether it survives.

Common problems

  • The date is off by a fixed number of hours. A time zone mismatch. The same instant is a different wall-clock time in every zone, and UTC equals "local time" only if you live there.
  • A time near a daylight-saving change does not round-trip. Springing forward skips an hour, so a wall-clock time inside the gap never happens. Falling back repeats one, so it maps to two instants and only one can be picked.
  • A large "nanoseconds" value does not come back exactly. JavaScript keeps full integer precision only to 253 - 1 (9,007,199,254,740,991), which a nanosecond epoch already exceeds. The date stays accurate to the millisecond.

Frequently asked questions

Can this handle dates before 1970?

Yes. A negative epoch counts backwards from 1970-01-01T00:00:00Z and converts the same way.

What is RFC 2822 format?

The date format in RFC 2822 §3.3, still used by email headers and a fair amount of HTTP tooling: Tue, 14 Nov 2023 22:13:20 +0000.

Why does the badge say "milliseconds" for a small-looking number?

Detection uses digit count, not whether the number looks like a familiar date. Thirteen digits is the millisecond band whatever date it names.

Is the timestamp in seconds or milliseconds?

Ten digits is seconds, thirteen is milliseconds, sixteen is microseconds and nineteen is nanoseconds, for any date in the current era. This page reads the length and says which it assumed, because getting it wrong puts you in 1970 or in the year 56000.