Unix Timestamps: Seconds vs. Milliseconds & UTC

Learn how Unix epoch time counts from 1970-01-01T00:00:00Z, how to tell 10-digit seconds from 13-digit milliseconds, and how negative pre-1970 values work.

SwiftCalcKit · Updated November 28, 2026

Short answer

Unix time measures non-leap seconds or milliseconds from 1970-01-01T00:00:00Z; modern 10-digit values are seconds and 13-digit values are milliseconds.

Scope and assumptions

Follows POSIX/JavaScript UTC epoch conventions for 1900–2100; excludes leap-second step adjustments.

Short answer: Unix time counts non-leap seconds (or milliseconds) elapsed since the UTC epoch 1970-01-01T00:00:00Z. For modern dates, 10 digits are seconds (1767225600 = 2026-01-01T00:00:00Z) and 13 digits are milliseconds (1700000000123 = 2023-11-14T22:13:20.123Z).

Spotting the timestamp unit by digit length

Unit mismatch is the single most common bug when reading API payloads, JWT claims, database rows, and browser logs. Check the digit length before decoding in the Unix Timestamp Converter:

Digit count (modern dates) Unit Scale relative to seconds Common sources
10 digits Seconds (s) 1 POSIX APIs, JWT exp / iat, Go time.Now().Unix(), SQLite
13 digits Milliseconds (ms) 1,000 JavaScript Date.now(), Java currentTimeMillis(), JSON logs
16 digits Microseconds (µs) 1,000,000 PostgreSQL, Python time.time_ns() // 1000, Parquet
19 digits Nanoseconds (ns) 1,000,000,000 Go UnixNano(), Linux kernel tracing, Prometheus/OTel

If you receive a 16-digit microsecond or 19-digit nanosecond integer, divide by 1,000 or 1,000,000 respectively to get milliseconds before pasting into standard web converters.

Checked reference timestamps table

Every UTC instant below can be reproduced directly in the converter:

Milestone Unix seconds Unix milliseconds Exact UTC ISO 8601
One day before epoch -86400 -86400000 1969-12-31T00:00:00.000Z
Unix Epoch zero 0 0 1970-01-01T00:00:00.000Z
1.7 billion + 123 ms 1700000000.123 1700000000123 2023-11-14T22:13:20.123Z
Start of 2026 UTC 1767225600 1767225600000 2026-01-01T00:00:00.000Z
Signed 32-bit max (Y2038) 2147483647 2147483647000 2038-01-19T03:14:07.000Z

Pre-1970 values, time zones, and leap seconds

  • Negative timestamps work cleanly: Dates before January 1, 1970 simply count backward in negative seconds—each full UTC day equals exactly 86,400 seconds (-86400 is December 31, 1969 at midnight UTC). Our converter validates instants from 1900 through 2100.
  • Timestamps carry no time zone: A Unix integer identifies one unambiguous global instant in UTC. Converting that instant to New York, London, or Shanghai changes only the rendered local wall clock, never the stored number. To inspect how one instant maps across cities and daylight-saving transitions, pair it with the Time Zone Converter.
  • POSIX leap-second convention: Under POSIX rules, every UTC day is fixed at exactly 86,400 seconds, so Unix timestamps do not accumulate inserted leap seconds. Specialized scientific timing systems that require continuous atomic elapsed seconds use TAI or GPS time instead.

Common debugging pitfalls

  1. Passing milliseconds to a seconds decoder: Feeding 1700000000123 into a seconds field yields a date past the year 55,000. Always switch the unit selector to milliseconds (ms) or divide by 1,000.
  2. Mixing local wall clock with UTC input: Entering a local timestamp like 2026-01-01 00:00 without specifying your offset can shift the resulting integer by hours. Confirm whether your source log is UTC (Z) or local time before encoding.
  3. 32-bit integer truncation: Legacy databases or C structs storing time_t in signed 32-bit integers wrap into negative numbers immediately after 2147483647 (2038-01-19T03:14:07Z). Use signed 64-bit integers (BIGINT / int64) in all new schemas.

Frequently asked questions

Why did my 13-digit timestamp decode to the year 55,000+?

You passed a millisecond timestamp into a decoder expecting seconds. Switch the unit mode to milliseconds (ms) or divide the integer by 1,000.

Does a Unix timestamp change during daylight saving time?

No. Unix time increases monotonically in UTC and never skips or repeats an hour when local regions enter or exit Daylight Saving Time.

What is the Year 2038 problem?

Signed 32-bit integer timestamps overflow after 2147483647 (2038-01-19T03:14:07Z). Modern 64-bit systems and JavaScript safe integers represent dates cleanly far beyond 2100.

How do I convert a 16-digit microsecond timestamp from PostgreSQL or Python?

Divide the 16-digit value by 1,000 to obtain 13-digit milliseconds (or by 1,000,000 for seconds), then paste the converted number into the tool with the matching unit selected.

Sources

unix-timestamp · epoch · utc