s · ms · μs · ns

Seconds to milliseconds
and smaller Unix units

Convert one instant exactly among Unix seconds, milliseconds, microseconds and nanoseconds. Select the source unit yourself to avoid a 1,000-fold mistake, then verify the UTC and Korea dates.

Convert Unix time units

Select the unit represented by the input. The same instant is calculated in all four units and shown as a date.

Four units for the same instant—
Seconds (s)
—
Milliseconds (ms)
—
Microseconds (μs)
—
Nanoseconds (ns)
—
Exact ISO 8601 UTC
—
UTC date—
Korea date (KST)—

—

Your number is converted only on this page. It is not sent or stored.

Seconds, milliseconds, microseconds and nanoseconds

Each unit is 1,000 times smaller than the one before it. Learn the relationship from seconds to check digit counts quickly.

UnitSymbolUnits in one secondConvert to seconds
Seconds1Use as entered
Millisecondms1,000Divide by 1,000
Microsecondμs1,000,000Divide by 1,000,000
Nanosecondns1,000,000,000Divide by 1,000,000,000
A smaller unit does not always mean rounding. An exact nanosecond value can be displayed as fractional seconds while retaining all nine decimal places.

Estimating the unit from length

Length is a useful clue for positive values near the present, but always check the converted date.

10 digits: likely seconds

1704067200 seconds is 2024-01-01 00:00:00 UTC.

13 digits: likely milliseconds

1704067200000 milliseconds is the same instant with three more digits.

16 or 19 digits: finer units

The same instant has 16 digits in microseconds and 19 in nanoseconds.

Length rules change near 1970 and in the far future. Leading zeros, signs and fractions also alter length. When the source unit is known, select it directly.

Fractional and negative Unix time

Unix time can represent instants before the epoch and intervals shorter than one second.

.5

Fractional seconds

0.5 seconds is 500 milliseconds after the epoch. A seconds input may contain up to nine fractional digits.

−1

Negative time

-1 second is one second before 1970-01-01 00:00:00 UTC.

38

The 2038 boundary

2147483647 seconds is the maximum signed 32-bit value. Check that storage supports a wider range for later dates.

The Unix epoch and leap-second model are described in the POSIX time rationale. Calendar display limits are covered by MDN Date.

Unix unit conversion questions

Answers about the factor of 1,000, digit length, fractions and negative values.

How many milliseconds are in one second?

One second contains 1,000 milliseconds. Multiply seconds by 1,000 to get milliseconds and divide milliseconds by 1,000 to get seconds.

What is the difference between a 10-digit and 13-digit timestamp?

For typical present-day Unix values, 10 digits usually represents seconds and 13 digits milliseconds. Historical and far-future values can have different lengths.

Can fractional seconds be converted to milliseconds?

Yes. For example, 1.25 seconds equals 1,250 milliseconds, 1,250,000 microseconds and 1,250,000,000 nanoseconds.

What does a negative timestamp mean?

It identifies an instant before the Unix epoch at 1970-01-01 00:00:00 UTC. For example, -1 second is 1969-12-31 23:59:59 UTC.

Why does choosing the wrong unit produce a completely different date?

Seconds and milliseconds differ by a factor of 1,000. Reading 1704067200 as seconds gives a date in 2024, while reading it as milliseconds gives a date in January 1970.