Seconds vs milliseconds
One second is 1,000 milliseconds. A seconds timestamp in 2026 has 10 digits; the same instant in milliseconds has 13. The fastest sanity check is the digit count, followed by the year: 13 digits interpreted as seconds lands tens of thousands of years in the future.
Date.now() // 1763311200000 (ms)
Math.floor(Date.now()/1000) // 1763311200 (s)
new Date(1763311200000) // Date object from ms
new Date(1763311200 * 1000) // Date object from s
Where milliseconds are standard
- JavaScript
Date.now()andnew Date(value) - Java
System.currentTimeMillis()andInstant.toEpochMilli() - Many logging frameworks and tracing spans
- Ethereum block timestamps (seconds, actually — do not assume)
- PostgreSQL
EXTRACT(EPOCH FROM ts) * 1000when exporting to JS
Ethereum and many blockchain APIs use seconds even though they look modern. Check the schema; a 10-digit value is seconds.
Precision beyond milliseconds
Microseconds (16 digits) and nanoseconds (19 digits) appear in profiling and high-resolution timers. They do not fit a JavaScript Number without loss: 2^53 is about 9e15, so nanosecond epoch values exceed safe integer precision. Use BigInt or keep them as strings.