keepcalculator

06 Numbers and Powers

Unix Time Converter Milliseconds: How It Works

Card No. 06·88828 · Updated · Standard formula, shown below

Date and time (UTC) 28500000:00:00 h:mm:ss
Seconds
1,710,000,000 s
Result
Milliseconds
1710000000000 ms
You entered
You enter
Milliseconds
You get
Date and time (UTC), Seconds
Rounding
h:mm:ss · 0 dp

Unix time converter milliseconds tools convert a Unix timestamp (seconds or milliseconds since January 1, 1970 UTC) into a human-readable date and time, or do the reverse. You enter a number like 1710000000000 and get 2024-03-09 16:00:00 UTC; enter a date and get the millisecond timestamp. This article explains the math, the common pitfalls, and how to pick the right converter for your needs.

Formula

The core formula is simple: Unix time = number of seconds elapsed since 1970-01-01 00:00:00 UTC, ignoring leap seconds. For milliseconds, divide by 1000 first:

  • ms – input timestamp in milliseconds (e.g., 1710000000000)
  • seconds = ms ÷ 1000
  • date = UTC time corresponding to seconds after the epoch

In the calculator above, the first output shows the date as h:mm:ss (minutes format), and the second output gives the raw seconds value. The conversion is linear and deterministic – no timezone math is involved until you display it locally.

Worked Example

Using the default value 1710000000000 ms:

  1. Divide by 1000: 1710000000000 ÷ 1000 = 1,710,000,000 seconds
  2. Convert to days: 1,710,000,000 ÷ 86400 = 19,791.666… days
  3. Add to epoch (1970-01-01): 19,791 days later is 2024-03-09 (accounting for leap years)
  4. The fractional day .666… × 24 h = 16 hours → 16:00:00 UTC

Result: 2024-03-09 16:00:00 UTC, which matches the calculator output.

Why Milliseconds Matter

Many programming languages and APIs return timestamps in milliseconds because they offer higher precision than seconds. JavaScript’s Date.now() returns milliseconds; Python’s time.time() returns seconds as a float. Databases like MySQL store BIGINT milliseconds for event logs. If you feed a millisecond value into a seconds-based converter, you get a date in 1970 – a classic bug. Always check the number of digits: seconds timestamps are 10 digits (until 2286), milliseconds are 13 digits.

Choosing a Converter

When picking a Unix time converter, look for these features:

  • Input format detection – automatically recognizes seconds vs. milliseconds
  • Timezone display – shows UTC and your local time separately
  • Reverse conversion – date to timestamp, not just timestamp to date
  • Precision – handles fractional seconds (e.g., 123.456 ms)
  • Batch conversion – paste multiple timestamps at once

Most online tools are free and run entirely in your browser, so no data leaves your machine. For command-line users, date -d @1710000000 on Linux or datetime.fromtimestamp(ms/1000, tz=utc) in Python works without a web tool.

Common Problems and Pitfalls

The most frequent mistakes are unit confusion and timezone errors:

  • Seconds vs. milliseconds – a 13-digit number is milliseconds; a 10-digit number is seconds. Mixing them shifts the date by ~49 years.
  • Timezone display – the Unix epoch is UTC. If your converter shows local time, it must apply your offset. A timestamp of 0 is 1970-01-01 00:00:00 UTC, not your local midnight.
  • Leap seconds – Unix time ignores them. The actual UTC time may differ by up to 27 seconds from the Unix calculation, but this rarely matters for everyday use.
  • Negative timestamps – dates before 1970 are valid (e.g., -86400 = 1969-12-31). Some converters reject negatives; ours allows them.
  • Fractional milliseconds – some systems store microseconds (16 digits) or nanoseconds (19 digits). Convert to milliseconds first.

Milliseconds vs. Seconds: Which to Use?

Use seconds when you need human-readable dates and compatibility with older systems (e.g., Unix date command, HTTP headers). Use milliseconds when working with JavaScript, high-frequency logs, or APIs that specify ms. The trade-off is range: seconds cover up to 2286; milliseconds up to 275760. For most applications, seconds are sufficient, but millisecond precision avoids collisions when multiple events occur within the same second.

How to Convert Manually

If you’re without a tool, here’s the manual method:

  1. Divide the timestamp by 1000 if it’s in milliseconds.
  2. Divide the result by 86400 to get days.
  3. Add the whole days to 1970-01-01, accounting for leap years (every 4 years, except centuries not divisible by 400).
  4. Multiply the fractional day by 24 to get hours, then by 60 for minutes, then by 60 for seconds.

For example, 1710000000 seconds → 19,791 days + 0.666… day → 2024-03-09 16:00:00 UTC. This manual method is error-prone for leap years, so use a converter for anything important.

Frequently Asked Questions

What is the current Unix timestamp in milliseconds?

It changes every millisecond. As of March 2024, it’s around 1,710,000,000,000. You can get it in JavaScript with Date.now() or in Python with int(time.time()*1000).

Why does my converter show 1970 for a 13-digit number?

Because the tool expects seconds, not milliseconds. A 13-digit number like 1710000000000 is milliseconds; divide by 1000 to get 1,710,000,000 seconds, which is 2024. If you feed the raw ms into a seconds converter, it interprets it as ~54,000 years after 1970, but most tools cap at a reasonable range and show 1970 due to overflow.

How do I convert a date to a Unix timestamp in milliseconds?

Take the date in UTC, calculate the seconds since 1970-01-01 00:00:00, then multiply by 1000. In JavaScript: new Date('2024-03-09T16:00:00Z').getTime(). In Python: int(datetime(2024,3,9,16,0,tzinfo=utc).timestamp()*1000).

Is Unix time the same everywhere?

Yes, the numeric value is identical worldwide because it’s defined as UTC. However, the displayed local time differs by timezone. A timestamp of 1710000000000 is 16:00 UTC, which is 11:00 EST or 17:00 CET, but the number itself is the same.

What happens after the year 2038?

On 32-bit systems, the signed integer maximum is 2,147,483,647 seconds, which is January 19, 2038. After that, the counter overflows to negative numbers. Most modern systems use 64-bit integers, so this is no longer an issue, but legacy software may still break.

Can I convert milliseconds to a date in Excel?

Yes. Divide the milliseconds by 86400000 (ms per day) and add to the date 1970-01-01. In Excel: =DATE(1970,1,1) + A1/86400000, then format the cell as a date. For timezone, add your offset hours divided by 24.

Related

Formula used
in ms | Milliseconds | ms | 1710000000000 | 0 | 9999999999999
out date | Date and time (UTC) | - | ms / 1000 | time
out seconds | Seconds | s | ms / 1000 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →