Unix Timestamp
Also known as: Unix time, epoch time, POSIX time, epoch seconds, time_t
A Unix timestamp is a single number counting the seconds elapsed since 1970-01-01T00:00:00Z, ignoring leap seconds — a time zone-free, language-agnostic way to name an exact instant, which is why it is what logs, databases, and APIs store internally.
Overview
The appeal is that it is just an integer. There is no time zone to misread, no ambiguity about whether 03/08 means March or August, and comparing two instants is plain arithmetic. That epoch — midnight UTC on 1 January 1970 — was chosen for early Unix simply because it was conveniently close to the era the systems ran in, and it stuck.
The first thing to know is that a Unix timestamp is not a true count of elapsed seconds. POSIX defines it with a formula that assumes every day contains exactly 86,400 seconds, so the 27 leap seconds inserted into UTC between 1972 and 2016 do not exist as far as Unix time is concerned. Two timestamps 86,400 apart are always the same wall-clock time the next day, which is what calendar code wants, but the interval between them is not necessarily 86,400 SI seconds. If you need genuinely monotonic elapsed time, use a monotonic clock, not wall-clock epoch differences.
The second is units. Classical Unix time is seconds, but nothing labels the number, so the same instant appears with three, six, or nine extra digits depending on where it came from: milliseconds in JavaScript and Java, microseconds in Cassandra write times, nanoseconds in Go, OpenTelemetry, and InfluxDB. Digit count is the practical tell — around 10 digits is seconds, 13 milliseconds, 16 microseconds, 19 nanoseconds — and misreading it by a factor of 1,000 is the single most common epoch bug, producing a date in 1970 or somewhere around the year 56,000.
The third is the ceiling. A signed 32-bit time_t cannot exceed 2,147,483,647, so it runs out at 03:14:07 UTC on 19 January 2038 and wraps to 1901 — the Year 2038 problem, still live in embedded systems, old file formats, and any database column typed as a 32-bit int. Nanosecond timestamps have their own quieter ceiling: 19 digits exceeds what a 64-bit float can represent exactly, so any code that passes one through a JavaScript number loses the last few digits before it even starts converting.
Common questions about Unix Timestamp
Is a Unix timestamp always in seconds?
Does Unix time account for leap seconds?
Can a Unix timestamp be negative?
What is the Year 2038 problem?
Why do systems store Unix time instead of a formatted date?
Tools that work with Unix Timestamp
Related concepts
ISO 8601
ISO 8601 is the international standard for writing dates and times as text — 2026-08-03T14:30:00Z — ordering every field from largest to smallest so the result is unambiguous worldwide and sorts correctly as a plain string.
ULID
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded as 26 Crockford base32 characters that is sorted by time when generated, making it a drop-in replacement for UUID v4 with much better database insert performance.
Cron Expression
A cron expression is a five-field string (or six fields with the Quartz seconds extension) that describes a recurring schedule — used by Unix cron, Kubernetes CronJobs, GitHub Actions schedules, and most modern job runners to say things like 'every 15 minutes' or 'every weekday at 9am'.