Article

Why Some Timestamps Are 10 Digits and Others Are 13

Published 2026-09-14

Same idea, two different units

A Unix timestamp counts elapsed time since midnight UTC on January 1, 1970. The original standard counts in seconds, which is why a current timestamp looks like a 10-digit number. But many modern languages and databases — JavaScript's Date.now() among them — count in milliseconds instead, for finer precision, which is why the same moment shows up as a 13-digit number there.

Why the mismatch causes real bugs

If a system expecting seconds receives a millisecond value (or vice versa), the resulting date is off by a factor of 1,000 — which usually doesn't land anywhere near the correct date, and can land somewhere absurd (a millisecond value misread as seconds points to a date roughly 30,000 years in the future). This is one of the most common "why is this date wrong" bugs when passing timestamps between a JavaScript frontend and a backend written in a language that defaults to seconds, like Python or PHP.

The quick visual check

As a rule of thumb for anything near the present day: 10 digits means seconds, 13 digits means milliseconds. This holds until the year 2286, when second-based timestamps themselves grow an 11th digit.

Try it yourself

Our Timestamp Converter auto-detects which unit you've pasted in based on its length, so you don't have to do the digit-counting yourself.

Ready to try it yourself?
Open the Timestamp / Unix Time Converter →