Skip to content
DDevToolery

My timestamp converted to 1970

Almost always a seconds-versus-milliseconds mix-up.

Unix time is defined in seconds. JavaScript, Java and most JSON APIs use milliseconds. The same number read the wrong way produces either 1970 or a date thousands of years away.

Counting digits

  • Ten digits — seconds. Somewhere between 2001 and 2286.
  • Thirteen digits — milliseconds.
  • Sixteen digits — microseconds. Divide by a thousand before pasting.

In the tool

The timestamp converter guesses from the digit count and shows which reading it used in the status rail. If the guess is wrong, override it with the Interpret as dropdown.

The JWT case

JWT exp, iat and nbf claims are in seconds, but Date.now() in JavaScript is milliseconds. Comparing them without multiplying by 1000 makes every token look expired. This is the single most common date bug in token handling.