ezsloth
Comparison

Seconds vs milliseconds in timestamps: the difference that breaks conversions

Learn the difference between timestamp values in seconds and milliseconds so you can avoid bad conversions.

Comparison

Seconds and milliseconds look similar but mean different things

The visible difference is small, but the result changes completely.

Seconds

More compact format

Common in APIs, logs, and systems that keep classic Unix timestamps.

Milliseconds

More precision

Common in JavaScript and systems that need finer time resolution.

Common mistake

Reading one as the other

That shifts the date and breaks validations or comparisons.

Checklist

Before using a timestamp in code or reports

Did you count the digits?

That is the simplest clue to suspect the format.

Did you test the conversion?

A readable date confirms or rejects your assumption.

Did you check the source?

Documentation or the source system often clarifies the format.

Is your workflow mixing both formats?

If so, normalize them early to avoid later mistakes.

Key point

Why this distinction matters

You avoid impossible dates

When you read milliseconds as seconds, or the other way around, the resulting date can move by years or even centuries.

It improves integrations

APIs, SDKs, and databases do not always document the format the same way, so it is worth confirming it before using it.

It makes debugging faster

Finding the right scale saves you from chasing false timezone or serialization issues.

How to check it

A quick way to separate seconds and milliseconds

1

Count the digits

As a rule of thumb, 10 often means seconds and 13 often means milliseconds.

2

Convert and validate the date

If the output looks impossible, you are probably using the wrong scale.

3

Review the source

Logs, SDKs, and APIs often have a specific convention worth checking.

4

Stay consistent

Once you identify the format, avoid mixing both scales inside the same workflow.

Common cases

Where this confusion usually appears

JavaScript integrations

JavaScript often works with milliseconds while other systems send seconds.

APIs and webhooks

Some responses change format depending on the language or endpoint.

Databases and logs

It also happens when comparing time marks stored in different systems.

FAQ

Common questions about seconds and milliseconds

Does 10 digits always mean seconds?

Almost always, but it is still best to validate with context and a real conversion.

Does JavaScript use seconds or milliseconds?

It usually works with milliseconds in Date objects and related timestamps.

How can I tell quickly if I got it wrong?

If the date looks far too old, too far in the future, or outside the expected context, check the scale.

Is this the same as a timezone issue?

No. First confirm the scale and only then check UTC versus local time.

Keep exploring

Related pages and tools

Check it now

Find out whether your value is in seconds or milliseconds

Paste the number into the converter and compare both formats before you continue working with the date.