Developer guide
What Is a Unix Timestamp? Epoch Time Explained
What Unix time is, why it starts in 1970, how to tell seconds from milliseconds, how time zones fit in, and how to convert timestamps in common languages.
By M2Toolkit Editorial TeamPublished 6 min read
Quick answer
A Unix timestamp is the number of seconds since 00:00:00 UTC on January 1, 1970 (the “Unix epoch”), not counting leap seconds. For example, 1767225600 is midnight UTC on January 1, 2026. Many systems, including JavaScript, use milliseconds instead, so a 13-digit number is usually milliseconds.
Timestamps show up in logs, databases, APIs, JWTs and cookies. They're popular because a single number is easy to store, compare and sort, and it means the same instant everywhere in the world, whatever the local time zone.
Why 1970?
Unix was developed at Bell Labs around 1969–1971, and its designers needed a recent, round starting point for the system clock. January 1, 1970 was simply convenient. Dates before 1970 are written as negative numbers.
Seconds, milliseconds, microseconds
The quickest way to tell units apart is the number of digits (for dates in this era):
| Digits | Unit | Example | Used by |
|---|---|---|---|
| 10 | Seconds | 1767225600 | Unix, PHP, Python time.time(), JWT |
| 13 | Milliseconds | 1767225600000 | JavaScript Date.now(), Java |
| 16 | Microseconds | 1767225600000000 | PostgreSQL, some logs |
| 19 | Nanoseconds | 1767225600000000000 | Go, high-precision systems |
Timestamps and time zones
A timestamp has no time zone: it identifies one instant for the whole planet. Time zones only matter when you display it. 1767225600 is midnight in London but 7:00 PM on December 31 in New York.
Converting in code
| Language | Current timestamp (s) | Timestamp → date |
|---|---|---|
| JavaScript | Math.floor(Date.now() / 1000) | new Date(ts * 1000) |
| Python | int(time.time()) | datetime.fromtimestamp(ts, timezone.utc) |
| PHP | time() | date("c", $ts) |
| SQL (PostgreSQL) | extract(epoch from now()) | to_timestamp(ts) |
| Bash | date +%s | date -d @ts |
The year 2038 problem
Systems that store timestamps as signed 32-bit integers can count only up to 2,147,483,647 — which is 03:14:07 UTC on January 19, 2038. After that, the number wraps to a negative value. Modern systems use 64-bit timestamps, which last for billions of years, but old embedded devices and databases may still need updating.
Frequently asked questions
Do Unix timestamps include leap seconds?
No. Unix time pretends every day has exactly 86,400 seconds, which keeps the math simple. Leap seconds are absorbed by the clock adjusting slightly.
What timestamp is it right now?
The Unix Timestamp Converter shows the current timestamp, updating every second.