BackendBench
Coffee
Free tool

Epoch & ISO-8601 converter

Paste a Unix timestamp (seconds, milliseconds, micro or nanoseconds) or a date. It figures out the unit and shows the time in several zones.

Code

Seconds, milliseconds and the 1970 epoch

A Unix timestamp counts time since 1 January 1970 00:00:00 UTC. Systems differ on the unit: Unix tools and JWT claims use seconds, while Java's System.currentTimeMillis() and JavaScript's Date.now() use milliseconds. Databases such as Oracle and PostgreSQL have their own functions to convert between the two.

Getting the unit wrong is the classic bug: a seconds value read as milliseconds lands in January 1970, and the other way round lands tens of thousands of years in the future. This tool shows the detected unit so you can spot it immediately.

Frequently asked questions

How do I know if a timestamp is in seconds or milliseconds?

Count the digits. Ten digits (like 1760000000) is seconds; thirteen (like 1760000000000) is milliseconds. This tool detects it automatically, and also recognises microseconds and nanoseconds.

What is the Java code to convert epoch milliseconds?

Instant.ofEpochMilli(ms) for milliseconds, or Instant.ofEpochSecond(s) for seconds. Add .atZone(ZoneId.of("Asia/Kolkata")) to see local time.

Why is my Java date off by 1000?

Mixing seconds and milliseconds. System.currentTimeMillis() returns milliseconds, while many APIs and JWT claims use seconds.

Is the Unix epoch always UTC?

Yes. The epoch is 1970-01-01T00:00:00Z. A timestamp never carries a time zone; zones only matter when you display it.

More tools you might need