Developer Time · Explainer

What Is a Unix Timestamp? A Developer's Guide

Every log line, API payload, and database column that stores "time" is probably storing it as one long number. Here's exactly what that number means, why it has no time zone, and where it quietly breaks.

By Reviewed 7 min read

Key takeaways

  • A Unix timestamp is a single integer counting the whole seconds elapsed since the Unix epoch, 00:00:00 UTC on 1 January 1970.
  • It carries no time zone of its own — the same number is the same instant everywhere on Earth; a time zone is only added when the value is displayed.
  • The digit count gives away the unit: 10 digits is usually seconds, 13 is milliseconds, 16 is microseconds, 19 is nanoseconds.
  • Classic 32-bit Unix time overflows at 03:14:07 UTC on 19 January 2038 — the "Year 2038 problem."
  • Negative Unix timestamps are valid and simply describe a date before 1970.

Open a server log, a database row, or a JWT payload and wherever a date should be, you'll usually find the same thing: a plain integer like 1735689600. No day name, no month, no time zone — just a number that keeps climbing by one every second. That number is a Unix timestamp, and once you know how to read it, values like that stop looking cryptic and start looking exact.

This guide covers what the number actually represents, why it never carries a time zone, how to tell seconds from milliseconds from nanoseconds at a glance, and the overflow bug — the Year 2038 problem — that still catches production systems off guard. If you just need to convert one timestamp right now, the Unix timestamp converter does it instantly; if you want the full picture, keep reading.

01What a Unix timestamp actually is

A Unix timestamp is the number of whole seconds that have elapsed since a fixed reference instant: 00:00:00 UTC on 1 January 1970, called the Unix epoch. Every moment after that point is a positive, ever-increasing integer; every moment before it is negative. There's no built-in notion of a calendar, a month name, or a day of the week in the number itself — those are all things a program calculates afterward.

You'll see the underlying idea called a few different names — Unix time, POSIX time, and epoch time — used mostly interchangeably. "Epoch" strictly refers to the starting instant itself, while "timestamp" refers to any specific count taken from it, but in practice the terms all point at the same integer.

A concrete example: 1735689600 means exactly one thing, everywhere, on any device, in any time zone — 00:00:00 UTC on 1 January 2025. For the history behind why 1 January 1970 was chosen as the starting line, see Unix Epoch Time Explained.

02Seconds, milliseconds, microseconds, nanoseconds

The original definition counts seconds, but plenty of modern systems need finer resolution, so the same idea just gets scaled. JavaScript's Date.now() returns milliseconds. Databases, tracing systems, and some logging libraries go further, to microseconds or nanoseconds. Each step down multiplies the previous value by 1,000 — and, conveniently, adds three more digits to the number.

Unix time precision · same instant, four units
UnitScale from secondsTypical digits (2020s–2090s)Example
Seconds× 1101735689600
Milliseconds× 1,000131735689600000
Microseconds× 1,000,000161735689600000000
Nanoseconds× 1,000,000,000191735689600000000000

Why "digit count" is a heuristic, not a rule

These digit counts hold for dates roughly between September 2001 and November 2286 in each unit. A timestamp from the 1970s or one set decades into the future can land on an unusual length, so treat the count as a fast first guess, then sanity-check the resulting date.

03Spot the unit: paste a timestamp

Because nothing in the number itself labels its unit, the fastest tell really is just how many digits it has. Paste any timestamp below — the tool guesses the unit from its length and previews the UTC date it points to.

Detect the unit & preview the date

—

—

Need the full conversion method?

This box is a quick teaching demo. For a step-by-step worked example — including how leap years and daylight saving fit in — see How to Convert a Unix Timestamp to a Readable Date, or use the Unix timestamp converter directly.

04Why a Unix timestamp has no time zone

A Unix timestamp counts seconds from one single, fixed instant defined in UTC. It doesn't matter what time zone the server, browser, or phone reading it is set to — the number 1735689600 is the same instant whether it's read in Karachi, London, or Los Angeles. A time zone only enters the picture when that instant gets turned into a human-readable date, because "what time was it locally" depends on where "locally" is. For the reference point every time zone is measured against, see What Is UTC?

A practical rule of thumb

Store and pass Unix timestamps as the raw number for as long as possible, and convert to a specific local time only at the last moment — right before it's shown to a person. Converting early and re-storing the converted value is how time-zone bugs creep into a codebase.

05Where you'll run into a Unix timestamp

Once you know to look for it, the format turns up almost everywhere machines record "when":

  • Server and application logs, where each line is stamped with the second (or millisecond) it was written.
  • REST and GraphQL API responses, in fields like created_at or updated_at.
  • Databases, both relational and NoSQL, storing "when" as a plain numeric column instead of a formatted string.
  • JWT tokens, whose iat, exp, and nbf claims are all Unix timestamps in seconds.
  • Git commits, which record author and committer time as a Unix timestamp plus a separate time-zone offset.
  • Cookies and cache headers that need an expiry instant a program can compare cheaply.

06Signed integers and the Year 2038 problem

Many older systems store Unix time in a signed 32-bit integer, which can only hold whole numbers from -2,147,483,648 to 2,147,483,647. Counted forward from the epoch, that upper limit lands on 03:14:07 UTC on 19 January 2038. One second later, a 32-bit signed counter that hasn't been upgraded overflows and wraps to a large negative number — which a naive system reads as a date far in the past rather than the present.

Most current systems and languages have moved to a 64-bit representation, which pushes the same kind of overflow so far into the future it isn't a practical concern. The risk sits specifically with older or embedded 32-bit systems that were never updated, which is why the Year 2038 problem is still discussed as a live migration issue rather than settled history.

07Common mistakes to avoid

  • Mixing seconds and milliseconds. Passing a millisecond value into a function that expects seconds (or the reverse) produces a date that's off by a factor of 1,000 — often landing thousands of years away from the intended one.
  • Assuming the count includes leap seconds. Unix time defines every day as exactly 86,400 seconds and does not count leap seconds, so it isn't a perfectly uniform measure of elapsed physical time across a leap-second event.
  • Treating the number as time-zone-aware. It isn't — see the section above. A raw timestamp tells you nothing about local time until you apply an offset.
  • Losing precision on very large numbers. JavaScript's safe integer limit is 9,007,199,254,740,991 (16 digits); nanosecond-scale timestamps (19 digits) can exceed it and need careful handling, not plain floating-point math.
  • Forgetting negative values are valid. A negative timestamp isn't an error — it's simply a date before 1970.

08Unix timestamp vs. ISO 8601 and human dates

A Unix timestamp and a human-formatted date solve different problems. The timestamp is compact, sorts correctly as a plain number, and is trivial for a computer to do arithmetic on — but it's unreadable at a glance and says nothing about a time zone by itself. A written standard like ISO 8601 (for example 2025-01-01T00:00:00Z) is readable, sortable as text, and can encode a time-zone offset directly in the string — at the cost of being a longer, more complex format to parse. Most real systems use both: a Unix timestamp internally for storage and math, converted to an ISO 8601 string only where a human or another system needs to read it. For the full breakdown of that format, see The ISO 8601 Date and Time Format, Fully Explained.

Convert a timestamp in one tap

Paste any Unix timestamp — seconds or milliseconds — and get the exact UTC date and time back instantly. Free, private, no sign-up.

Open the converter →

09Frequently asked questions

What is a Unix timestamp in simple terms?

It's a single integer counting the whole seconds that have passed since 00:00:00 UTC on 1 January 1970, known as the Unix epoch. The number climbs by one every second and never carries a date format, month name, or time zone of its own.

Is a Unix timestamp in seconds or milliseconds?

It depends on the system. The original definition is seconds, which today is a 10-digit number. Many languages and APIs — including JavaScript's Date.now() — use milliseconds instead, which is 13 digits. Counting the digits is the fastest way to tell them apart.

Does a Unix timestamp have a time zone?

No. A Unix timestamp counts seconds from a single fixed instant in UTC, so the same number means the same instant everywhere on Earth. A time zone is only applied when the number is converted into a human-readable date for display.

What is the Year 2038 problem?

Systems that store Unix time as a signed 32-bit integer can only count up to 2,147,483,647 seconds after the epoch, which is 03:14:07 UTC on 19 January 2038. One second later, the stored value overflows and wraps to a large negative number, making the represented date jump backwards.

Can a Unix timestamp be negative?

Yes. A negative Unix timestamp simply represents an instant before 1 January 1970. For example, -86400 is exactly one day before the epoch: 00:00:00 UTC on 31 December 1969.

How do I convert a Unix timestamp to a readable date?

Determine the unit from the digit count, then feed the value into your language's date function or a converter tool. The step-by-step method with a worked example is covered in How to Convert a Unix Timestamp to a Readable Date.

Fletcher Langley

Fletcher Langley

Time & Scheduling Specialist · 24hourto12hour.com

Operations and workforce-systems specialist with 14+ years inside shift-based industries and payroll platforms. Fletcher builds and reviews every tool on the site, and writes its guides so the method is always shown, not just the answer. Read his full profile →

Sources & standards

  1. The Open Group / IEEE Std 1003.1 (POSIX), Base Definitions, §4.16 "Seconds Since the Epoch" — the formal definition of Unix time used in this guide. opengroup.org
  2. RFC 3339, Date and Time on the Internet: Timestamps — the internet-standard timestamp format referenced for comparison. rfc-editor.org
  3. 32-bit overflow date and digit-count thresholds calculated directly from the POSIX definition and JavaScript's Number.MAX_SAFE_INTEGER limit. Last reviewed August 2026.