Skip to content
toolbelt
Back to Guides

Seconds or Milliseconds? Count the Digits

By ·

Updated

Ten digits is seconds, thirteen is milliseconds. Get it wrong and you are off by decades, not seconds.

What is this tool?

Unix time counts seconds since 1970. Many systems use milliseconds instead, and both look like ordinary integers.

How it works

Each line is read on its own. A numeric value is treated as seconds below thirteen digits and milliseconds above, unless you force a unit. Anything that is not numeric is parsed as a date and returned as the epoch value.

Example

1700000000     → 2023-11-14 22:13:20 UTC  (seconds)
1700000000000  → 2023-11-14 22:13:20 UTC  (milliseconds)

When to use it

Normalising a log export where services disagree. Checking a batch of values before an import. Converting a list of release dates for an API.

Optimization Tips

The digit rule is a heuristic. A timestamp for the year 2286 in seconds is also thirteen digits. Force the unit when the dates are historical or far future.

Frequently Asked Questions

Why did one value convert differently?
Because digit count determined its unit. Force the unit if you know it.
Can I paste dates too?
Yes. Anything not numeric is parsed as a date.
What about negative values?
Handled, for dates before 1970 within the supported range.
Is the list uploaded?
No.

Ready to try it out?

Put this knowledge into practice with our free tool.

Go to Tool

Related tools