What Is Epoch Time?
Epoch time is a single number: the count of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. That instant is called the Unix epoch, and the number is variously called epoch time, Unix time, POSIX time or a Unix timestamp — they all mean the same thing.
Because it is one integer in one time zone, it is unambiguous. "1 March 2026, 14:00" needs a time zone and a date format before two systems can agree on it; 1772373600 does not.
Why 1 January 1970?
It is an arbitrary but convenient choice. Unix was being developed at Bell Labs in the late 1960s, and the team needed a recent, round starting point that fit in the machine word sizes of the day. An earlier version counted sixtieths of a second from 1971, which overflowed in about two and a half years; moving to whole seconds from the start of 1970 gave a range measured in decades. It stuck, and is now baked into essentially every operating system, database and programming language.
Seconds or milliseconds?
This is the single most common source of confusion, because both are called "the timestamp".
- Ten digits is seconds — the Unix convention, used by most databases, Linux tools and APIs.
- Thirteen digits is milliseconds — the JavaScript convention, returned by Date.now().
- Sixteen digits is microseconds, and nineteen is nanoseconds — used by Go, some Python APIs and observability tooling.
- A quick sanity check: a seconds timestamp for any date in the 2020s starts with 1 and has ten digits. If your date lands in 1970, you passed seconds to something expecting milliseconds. If it lands tens of thousands of years in the future, you did the reverse.
What epoch time does not include
Unix time deliberately ignores leap seconds. Every day is treated as exactly 86,400 seconds, so when a leap second is inserted, Unix time repeats or stretches a second rather than counting it. This keeps the arithmetic simple — any date can be converted by dividing and multiplying — at the cost of being a few dozen seconds away from strict atomic time.
It also carries no time zone and no daylight saving information. Epoch time is always UTC. Local time is something you apply when you display the value, never something stored inside it.
The year 2038 problem
A signed 32-bit integer runs out at 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. Systems still storing time in a signed 32-bit field will wrap around to December 1901 at that moment. Modern 64-bit systems are unaffected — a signed 64-bit count of seconds lasts about 292 billion years — but embedded devices, old file formats and some database columns still need auditing.
Where you will meet it
- Log files and observability tooling, where a single sortable integer beats a formatted date.
- JWTs and session tokens, whose iat and exp claims are epoch seconds.
- HTTP caching, file system mtimes, and Git commit timestamps.
- Database range queries, where comparing integers is faster and less error-prone than comparing formatted dates.
Frequently asked questions
What is epoch time?
Epoch time is the number of seconds elapsed since 00:00:00 UTC on 1 January 1970, not counting leap seconds. It is also called Unix time, POSIX time or a Unix timestamp, and it is always expressed in UTC.
Why does epoch time start in 1970?
It was an arbitrary but convenient choice made while Unix was being developed at Bell Labs: a recent, round starting point that fit the machine word sizes of the day and gave a range measured in decades rather than years.
Is epoch time in seconds or milliseconds?
Unix epoch time is in seconds and has ten digits for current dates. JavaScript uses milliseconds, which is thirteen digits. Sixteen digits is microseconds and nineteen is nanoseconds.
Does epoch time include leap seconds?
No. Unix time treats every day as exactly 86,400 seconds, so leap seconds are repeated or stretched rather than counted. This keeps date arithmetic simple but leaves it a few dozen seconds off strict atomic time.
What is the year 2038 problem?
A signed 32-bit timestamp overflows at 03:14:07 UTC on 19 January 2038 and wraps to December 1901. Systems using 64-bit timestamps are unaffected.