milliseconds → date

Milliseconds to a real date

Thirteen digits means milliseconds — the format JavaScript, Java and most JSON APIs hand you. Paste it and read the date in UTC, locally and in any timezone.

ready

Runs locally in your browser.

the classic bug

Seconds and milliseconds look alike

One extra three-digit group changes the instant by a factor of a thousand. 1700000000 is 2023-11-14; 1700000000000 is the same moment; 1700000000000000 is the same moment in microseconds. Feed the millisecond value to a function that expects seconds and you land in the year 55828. Feed a seconds value to JavaScript’s new Date() and you land in 1970.

A quick test: count the digits. Ten is seconds, thirteen is milliseconds, sixteen is microseconds, nineteen is nanoseconds. If the number has eleven or twelve digits it is genuinely ambiguous — seconds lands far in the future, milliseconds lands in the early 1970s — so the converter says so and lets you switch.

Where milliseconds come from

  • Date.now() in JavaScript.
  • System.currentTimeMillis() in Java and Kotlin.
  • Most REST and GraphQL APIs that serialize timestamps as integers.
  • Browser performance entries and event timestamps, which use fractional milliseconds.

If you need the opposite direction, the date to timestamp converter gives you both units from any date.

advertisement