Tech Help

Unix Timestamp Seconds vs Milliseconds: Why Your Date Shows 1970

If a Unix timestamp becomes a date near 1970, the value is often seconds read as milliseconds. See how to tell the units apart.

Quick Answer

If a Unix timestamp gives you a date near 1970, the value is often being interpreted in the wrong unit.

Unix timestamps commonly use seconds, while JavaScript Date values commonly use milliseconds.

A modern 10-digit timestamp is often seconds, while a 13-digit timestamp is often milliseconds. If the units do not match, you may need to multiply or divide by 1,000.

You converted a timestamp to a date and landed in January 1970. That is rarely a broken clock. The number was read as milliseconds when it was stored as seconds—or the reverse.

What Is a Unix Timestamp?

A Unix timestamp measures time since the Unix epoch: 1970-01-01 00:00:00 UTC. It commonly uses whole seconds. The same instant can also be stored as milliseconds (seconds × 1,000). The number itself does not label the unit.

Seconds vs Milliseconds: The 1,000× Difference

One second equals 1,000 milliseconds. Compare 1720000000 with 1720000000000. When the first is seconds and the second is milliseconds, they mark the same instant. Read the first as milliseconds, and the date jumps toward 1970.

These UTC results were computed from the numbers above—not guessed.

Value Likely unit Interpretation (UTC)
1720000000 Seconds Modern date when read as seconds: 2024-07-03 09:46:40 UTC
1720000000000 Milliseconds The same instant when read as milliseconds: 2024-07-03 09:46:40 UTC
1720000000 as milliseconds Wrong unit Date near 1970: 1970-01-20 21:46:40 UTC

Why Does My Timestamp Show 1970?

If a seconds value is treated as milliseconds, the number is 1,000 times too small. JavaScript then counts only a short span after the Unix epoch, so the date sits in 1970:

const seconds = 1720000000;

new Date(seconds);
// 1970-01-20 21:46:40 UTC

new Date(seconds * 1000);
// 2024-07-03 09:46:40 UTC

That 1970 date is the epoch plus a couple of weeks. Multiply seconds by 1,000 before passing them to Date.

  • SECONDS
  • 1720000000
  • MILLISECONDS
  • 1720000000000
The same instant: seconds × 1,000 = milliseconds.
  • Seconds value
  • Mistakenly treated as milliseconds
  • Date near 1970
A seconds value read as milliseconds lands near the Unix epoch.
Seconds or Milliseconds?

If your result is near 1970, check the timestamp unit before troubleshooting the time zone.

Is a 10-Digit Timestamp Seconds and a 13-Digit Timestamp Milliseconds?

For modern dates, 10 digits are often seconds and 13 digits are often milliseconds. That is a quick clue, not a validation rule. Digit count changes with the time range, and some APIs store microseconds or nanoseconds. Confirm the unit against documentation or a date that makes sense.

Why This Happens So Often in JavaScript

In JavaScript, a numeric Date value is milliseconds since the epoch. Many backends, databases, and Unix tools still store seconds. Passing a seconds value straight into Date is therefore a frequent bug:

const unixSeconds = 1720000000;

const wrong = new Date(unixSeconds);
const correct = new Date(unixSeconds * 1000);

wrong is near 1970 (1970-01-20 21:46:40 UTC). correct is the modern instant (2024-07-03 09:46:40 UTC).

Other Systems Use Different Units

Other languages, APIs, and databases may use seconds or milliseconds. Some store microseconds or nanoseconds. Do not assume a language always uses one unit—check the documentation. If the number sits in JSON, JSON Formatter & Diff can make the field readable; it still will not tell you the unit.

How Can I Tell Which Unit My Timestamp Uses?

Work through these checks in order. Digit count alone is not enough.

  1. Check the API or database documentation.
  2. Look at the approximate number of digits.
  3. Compare the value with a plausible modern timestamp.
  4. Test the value as seconds and as milliseconds.
  5. Check whether the resulting date makes sense.

If one interpretation lands in 1970 and the other lands on a date you recognize, the unit mismatch is the cause.

Common Unix Timestamp Mistakes

  • Seconds interpreted as milliseconds. The date collapses toward 1970, as in the example above.
  • Milliseconds interpreted as seconds. The date jumps far into the future, or the conversion fails.
  • Multiplying by 1,000 twice. An already-millisecond value becomes huge and the date jumps centuries ahead.
  • Dividing by 1,000 twice. A seconds value shrinks again, back near 1970.
  • Blaming the time zone. A zone can shift hours or the calendar day. It does not move a modern timestamp into 1970.
  • Treating a formatted date string as a Unix timestamp. A value like 2024-07-03T09:46:40Z is not an epoch number. Parse it as a date string, not as seconds.

Does Time Zone Cause the 1970 Problem?

Usually, no. A time zone can change the displayed clock and, near midnight, the calendar date. It does not turn a modern Unix timestamp into 1970. If the result is in 1970, check seconds versus milliseconds first.

Convert and Check a Unix Timestamp

NEXNARA Date & Time Converter can convert a Unix timestamp in your browser.

Paste Unix seconds or milliseconds, use the current timestamp, see UTC and local time, convert time zones, and format a date. Auto-detect often treats 10-digit values as seconds and 13-digit values as milliseconds; you can still choose the unit.

The conversion itself happens in your browser. This tool does not send dates or timestamps to a NEXNARA server. Ads and other site features still use the network; that is separate from conversion.

Need to check a Unix timestamp? Open Date & Time Converter and compare seconds with milliseconds.

FAQ

Why does my Unix timestamp show 1970?

The value is often seconds that were read as milliseconds. JavaScript then treats a much smaller number, so the date sits shortly after 1970-01-01 00:00:00 UTC. Multiply seconds by 1,000 and convert again.

Are Unix timestamps seconds or milliseconds?

Unix timestamps commonly use seconds. Many web APIs and JavaScript Date values use milliseconds. Always check what that system documents. Some systems use microseconds or nanoseconds.

How do I convert seconds to milliseconds?

Multiply by 1,000. 1720000000 seconds is 1720000000000 milliseconds. To go the other way, divide by 1,000.

Why does JavaScript Date use milliseconds?

The numeric Date timestamp in JavaScript is defined as milliseconds since the Unix epoch. That is why new Date(unixSeconds) is wrong when unixSeconds is a Unix seconds value.

Is a 10-digit timestamp always seconds?

No. For modern dates it is often seconds, and 13 digits are often milliseconds. Digit count is a clue, not a rule. Confirm with documentation or a date that makes sense.

Does a Unix timestamp contain a time zone?

No. A Unix timestamp is an instant counted from 1970-01-01 00:00:00 UTC. Time zones affect how that instant is displayed, not the number itself.