Timestamp Converter Epoch

Epoch to date and back — seconds, millis, micros or nanos, in any time zone, with the Java that does the same thing.

In-browser & private
Advertisement
1 Timestamp ↔ date Paste an epoch number or a date string and read it back in any zone.
Epoch right now
—
—
Converted
Type a timestamp or a date above.
Java
—
2 Time zone to time zone Enter a wall-clock time, say where it was, and read it somewhere else.
Java for this conversion
—

Reading a timestamp correctly

  • Units are guessed by magnitude, and the guess is shown. Ten digits is almost always seconds, thirteen milliseconds. That heuristic breaks for dates far from today, so the unit it chose is always stated — and you can force it.
  • An epoch has no time zone. It is a count from 1970-01-01T00:00:00Z, the same instant everywhere. The zone only decides how that instant is written down, which is why the same number shows a different wall clock in Kolkata and in New York.
  • Millis are not always millis. System.currentTimeMillis() gives epoch millis, but System.nanoTime() is not an epoch at all — it only measures elapsed time and converting it to a date produces nonsense.
  • JavaScript loses precision past 2^53. Nanosecond timestamps exceed that, so nanos are handled as text here rather than as numbers; conversions stay exact to the second and the sub-second digits are carried through untouched.
  • A negative epoch is still seconds plus a fraction. -1500 millis is second -2 plus 0.500, not second -1. Carrying the minus sign into the whole part puts every pre-1970 value a second late, which is the classic way a date before the epoch goes quietly wrong.
  • A skipped hour does not fail, it moves. When the clocks jump forward, the hour in between never happens. ZonedDateTime shifts such a time forward by the length of the gap rather than throwing, so 02:30 becomes 03:30. Section 2 flags it and follows the same rule.

Frequently asked questions

Is my timestamp in seconds or milliseconds?
Count the digits. Ten digits is seconds and thirteen is milliseconds for any date between 2001 and 2286, which covers everything you are likely to paste. The unit this page picked is always stated next to the result, and the dropdown overrides it when the guess is wrong — which it will be for dates far from today.
What time zone is an epoch value in?
None. It counts seconds from 1970-01-01T00:00:00Z, so it names the same instant everywhere on Earth. A zone only decides how that instant is written down, which is why the same number reads as a different wall clock in Kolkata and in New York. Choosing a zone here changes the display and nothing else.
Why is my date before 1970 off by a second?
Because an instant is always a whole second plus a fraction between zero and one, and a negative value has to borrow. -1500 milliseconds is second -2 plus 0.500, not second -1. Java's Instant.ofEpochMilli does that borrowing for you; hand-rolled arithmetic that just moves the minus sign does not.
Why can one wall-clock time mean two different instants?
On the night the clocks go back, an hour repeats, so 01:30 happens twice. Section 2 detects it and asks which one you meant instead of guessing. In Java atZone silently picks the earlier one, so the generated code says withLaterOffsetAtOverlap when you choose the second.
What happens to a time inside a skipped hour?
When the clocks jump forward, the hour in between never exists. Java does not throw: ZonedDateTime shifts the time forward by the size of the gap, so 02:30 becomes 03:30. This page flags the input and shows the same instant Java would give you.
Can I trust a date string with no offset?
Only if you know whose clock wrote it. A bare 2026-08-10 is UTC by the ISO rule, but add a time and 2026-08-10T00:00:00 is read in the browser's own zone instead. The same log line then converts differently on two machines. This page names the zone it used and marks it as an assumption when the text did not say.

More free tools