Skip to content
FreeToolsKit.app

Converters & Utilities guide

Unix Timestamps in Seconds vs. Milliseconds: How to Tell Them Apart and Convert

8 min read · Updated 20 November 2026 · Uses Unix Timestamp Converter

Quick answer

If a converted date lands in January 1970, a value in seconds was read as milliseconds. If it lands tens of thousands of years ahead, or the conversion fails, a value in milliseconds was read as seconds. The two units differ by a factor of 1,000, so the date is either squeezed towards 1970 or pushed far into the future.

Unix time counts seconds since 1 January 1970 00:00:00 UTC, with every day counted as exactly 86,400 seconds (The Open Group: POSIX "Seconds Since the Epoch"). JavaScript counts the same thing in milliseconds (MDN: Date). To fix the date:

  1. Find the unit that the system which wrote the value uses (its documentation, not the number's length).
  2. Convert in that unit. Multiply seconds by 1,000 before passing them to JavaScript. Divide milliseconds by 1,000 before passing them to anything that expects seconds.
  3. Check the result is a plausible date for your data.

A common rule of thumb: for present-day dates, a 10-digit timestamp is usually seconds and a 13-digit one usually milliseconds. It's a convention from tool sites, not a standard, so use it as a hint only.

In the Unix Timestamp Converter, choose Timestamp → date, pick Seconds or Milliseconds under Timestamp unit, type the value and press Convert. The tool never switches the unit for you. If the value looks like the other unit, it shows a note instead.

Unix Timestamp ConverterFree to use · No account required · Calculated in your browserOpen Unix Timestamp Converter

Match the symptom to the cause

  • A date in January 1970, or a few months after it: a seconds value read as milliseconds. The value is 1,000 times too small.
  • A year such as 55840, or an "out of range" error: a milliseconds value read as seconds. The value is 1,000 times too large.
  • A date in December 1901: possibly a seconds counter that overflowed a signed 32-bit integer (see the 2038 section).
  • The right day, but a few hours out: not a unit problem. A date-time was read in the wrong time zone (see the last section).

The values tested

The test used fixed values, entered in the converter's real interface on 19 November 2026 in Chromium, with the browser's time zone set to Europe/London:

  • The pair: 1700000000 and 1700000000000, each entered once as Seconds and once as Milliseconds.
  • A fraction: 1700000000.123 in seconds, against 1700000000123 in milliseconds.
  • Before 1970: -1000000000 in seconds.
  • The 32-bit limit: 2147483647 and 2147483648 in seconds.
  • A date-time with an offset: 2026-03-29T01:30:00+01:00.

Every result was then checked with Python 3.13's fromtimestamp() in UTC and Node 22's new Date(). They agreed with the converter in every case.

What the converter showed

Steps used for each timestamp:

  1. Choose Timestamp → date.
  2. Under Timestamp unit, choose Seconds or Milliseconds.
  3. Type the value into Unix timestamp (seconds) or Unix timestamp (milliseconds). The label follows the unit.
  4. Press Convert.

Results, as the UTC line read:

  • 1700000000 as Seconds: "Tuesday, 14 November 2023, 22:13:20 UTC". No note.
  • 1700000000 as Milliseconds: "Tuesday, 20 January 1970, 16:13:20 UTC", with the note "This is within about four months of 1 January 1970. If your value is in seconds (10 digits for current dates), switch the unit to seconds."
  • 1700000000000 as Milliseconds: "Tuesday, 14 November 2023, 22:13:20 UTC". No note.
  • 1700000000000 as Seconds: "Sunday, 8 November 55840, 22:13:20 UTC", with the note "This is a very distant date. If your value is in milliseconds (13 digits for current dates), switch the unit to milliseconds."

The cross-checks reproduced both mistakes. In Node, new Date(1700000000), a seconds value passed straight to JavaScript, gave 1970-01-20T16:13:20.000Z. Python refused the opposite mistake: fromtimestamp(1700000000000) raised "ValueError: year 55840 is out of range", because Python's dates stop at the year 9999.

Each result also lists Unix time (seconds) and Unix time (milliseconds) side by side. Copy the one the receiving system expects.

Why the tool doesn't guess the unit

The converter states its rule under the unit choice: "The unit is never guessed: 1700000000 in seconds is November 2023, but in milliseconds it is January 1970."

The code shows how far the notes go. A note appears only for a seconds value of 100,000,000,000 or more (after the year 5138), or a milliseconds value under 10,000,000,000 (within about 116 days of 1970). It is text only: the value and the unit stay as you entered them.

Guessing would be unsafe because the digit-count rule only holds near the present. Epoch Converter, a timestamp tool site, describes timestamps "in seconds (10 digits), milliseconds (13 digits), microseconds (16 digits), and nanoseconds (19 digits)" (Epoch Converter). No standard says this. In the cross-checks, 10-digit seconds run from 9 September 2001 to 20 November 2286. A small value such as 86400 is one day after 1970 in seconds, but only 86.4 seconds after midnight on 1 January 1970 in milliseconds. Both readings are valid dates.

The converter handles only seconds and milliseconds. A 16-digit microsecond value, such as 1700000000000000, entered as Milliseconds converted to the year 55840 with no note. Divide microseconds by 1,000 first.

Which systems use which unit

Check the documentation for whatever produced the value:

  • JavaScript: milliseconds. Date objects hold "milliseconds since the midnight at the beginning of January 1, 1970, UTC", and Date.now() returns milliseconds too (MDN: Date).
  • Java: System.currentTimeMillis() returns the time "measured in milliseconds" since 1970 (Oracle: System, Java SE 21).
  • POSIX and Linux: seconds. The time() call "returns the time as the number of seconds since the Epoch" (man7.org: time(2)).
  • Python: seconds, often with a fraction. time.time() returns "the time in seconds since the epoch as a floating-point number" (Python: time).
  • PostgreSQL: seconds. to_timestamp() converts "Unix epoch (seconds since 1970-01-01 00:00:00+00)", and EXTRACT(EPOCH …) returns seconds with fractions (PostgreSQL: Date/Time Functions).
  • JWT: seconds. The exp, nbf and iat claims use NumericDate, "the number of seconds from 1970-01-01T00:00:00Z UTC", and "non-integer values can be represented" (IETF: RFC 7519). The JWT Decoder & Inspector converts these claims for you.
  • Go: both. time.Unix takes seconds, time.UnixMilli milliseconds and time.UnixMicro microseconds (Go: time package).

Fractions and negative values

A fraction is not a milliseconds value. 1700000000.123 as Seconds and 1700000000123 as Milliseconds gave the same instant: "Tuesday, 14 November 2023, 22:13:20.123 UTC". The first is seconds with three decimals, the second whole milliseconds. Python and Node agreed.

A fourth decimal, as in 1700000000.1234, was refused: "Seconds can have at most 3 decimal places (millisecond precision). The value isn't rounded; remove the extra digits." The code reads the digits as exact decimal text. Code that uses floating-point numbers works differently. In Python, the number 1700000000.123 is stored as 1700000000.1229999…, which happened to round back to .123 in this test.

Negative values are dates before 1970. -1000000000 converted to "Sunday, 24 April 1938, 22:13:20 UTC" in the tool, Python and Node. PostgreSQL documents negative epoch values for earlier dates (PostgreSQL: Date/Time Functions). POSIX itself says that for years before 1970 or negative values "the relationship is undefined" (The Open Group: POSIX), so not every system has to accept them. Python's time module, for example, warns that it "may not handle dates and times before the epoch" (Python: time).

The year 2038 limit, briefly

2147483647 is the largest value a signed 32-bit integer can hold. As seconds, it is "Tuesday, 19 January 2038, 03:14:07 UTC". One more, 2147483648, is 03:14:08 UTC on the same day. Both converted normally.

Systems that still store seconds in 32 bits can't go past that point. On Linux, a program built with a 32-bit time_t fails with an overflow error "when the time is 2038-01-19 03:14:08 UTC or later" (man7.org: time(2)). POSIX now requires at least 64 bits, "however, some systems still use 32 bits by default" (man7.org: time_t).

If the number wraps around instead of failing, 2147483648 becomes −2147483648 (checked with Python and Node's 32-bit integer types). The converter shows −2147483648 as "Friday, 13 December 1901, 20:45:52 UTC". A 1901 date in your data is a sign of this overflow.

The converter itself isn't limited to 2038. It covers JavaScript's full range of ±8,640,000,000,000,000 milliseconds, which MDN gives as 271822 BC to AD 275760 (MDN: Date).

When the date is right but the hours are wrong

Wrong hours usually mean a time-zone problem, not a unit problem. The test date-time 2026-03-29T01:30:00+01:00 was entered on the Date → timestamp tab, in Date and time (ISO 8601 with offset):

  • Result: "Sunday, 29 March 2026, 00:30:00 UTC", which is Unix time (seconds) 1774744200 and Unix time (milliseconds) 1774744200000.
  • Same instant: 2026-03-29T00:30:00Z gave the same numbers.

That matches RFC 3339, where an offset is "local time minus UTC", so "18:50:00-04:00 is the same time as 22:50:00Z" (IETF: RFC 3339). The local line in the London-set browser read 00:30:00 (UTC+00:00). The +01:00 belongs to whoever wrote the time, not to you.

The same text with no offset, 2026-03-29T01:30:00, was refused: "Add a time-zone offset: Z for UTC, ±HH:MM (for example +02:00) or ±HH:MM:SS. Times without an offset aren't read in your browser's time zone, because that would be a guess."

Common programming languages make that guess silently. JavaScript reads a date-time without an offset "in the local timezone of the system" (MDN: Date.parse()). Python likewise assumes "naive" date-times "represent local time" (Python: datetime). In the cross-checks, the same text gave 01:30 UTC with the time zone set to UTC or Europe/London, and 20:00 UTC on 28 March with it set to Asia/Kolkata. Neither is the 00:30 UTC the +01:00 version means. For more on offsets, see how to schedule meetings across time zones.

Before you trust a converted date

  1. Unit: you know the unit from the documentation of the system that wrote the value, not from its length alone.
  2. Plausible date: the result isn't in early 1970, a far-future year, or December 1901, unless your data really is.
  3. Both units agree: the milliseconds value is the seconds value times 1,000. The converter lists both.
  4. Offset: any date-time text you convert includes Z or an offset such as +01:00.
  5. UTC first: compare UTC times across systems, and convert to local time only for display.