What is an Epoch Timestamp?

How computers count time from a single moment in 1970

Every computer, smartphone, and server on the internet needs a way to represent time as a simple number. The solution most of the computing world adopted is the epoch timestamp — a single integer that counts the number of seconds elapsed since a fixed starting point. For the vast majority of systems, that starting point is midnight UTC on January 1, 1970, known as the Unix epoch.

What is an Epoch Timestamp?

An epoch timestamp (also called Unix time, POSIX time, or seconds since epoch) is a count of seconds that have passed since a predefined moment in time called the epoch. The most widely used epoch in computing is the Unix epoch: January 1, 1970 00:00:00 UTC. A timestamp of 0 represents that exact moment. A timestamp of 86400 represents January 2, 1970 — exactly one day later.

The format was designed by Ken Thompson and Dennis Ritchie during the early development of the Unix operating system at Bell Labs. Its simplicity is its greatest strength: a single integer can represent any point in time, requires no locale or timezone information to store, and can be trivially compared, sorted, and arithmetically manipulated.

86,400
Seconds in one day — the fundamental unit of epoch time

The Unix Epoch: Why 1970?

The choice of January 1, 1970 as the epoch was somewhat arbitrary but practically motivated. Thompson and Ritchie needed a reference point close to the start of their project, and the date needed to be in the past (so all timestamps would be positive at the time). The year 1970 was recent enough to be familiar, far enough from zero to avoid negative numbers for current dates, and it aligned with the beginning of the Unix project's development cycle.

The epoch is always expressed in Coordinated Universal Time (UTC). When a Unix timestamp is displayed as a human-readable date, the system must apply the appropriate timezone offset to show the correct local time. A timestamp represents the same instant everywhere on Earth — only the display changes.

It is worth noting that the Unix epoch is not the only epoch in computing. The GPS epoch is January 6, 1980. The Windows FileTime epoch is January 1, 1601. The .NET epoch is January 1, 0001. Each was chosen for different technical reasons, but the Unix epoch is by far the most universal.

How Epoch Timestamps Are Used

Epoch timestamps are the lingua franca of time in computing. They appear in:

The reason epoch timestamps are so ubiquitous is that they solve a problem that human-readable dates do not: they are unambiguous. "January 1, 2024" is different depending on whether you mean midnight in New York, London, or Tokyo. A Unix timestamp like 1704067200 means exactly one instant, regardless of where the reader is.

Converting Epoch Timestamps

Timestamp to Human Date

To convert a Unix timestamp to a readable date, you add the number of seconds to the epoch. Most programming languages and command-line tools provide built-in functions for this conversion.

Human Date to Timestamp

To convert a human-readable date to a timestamp, parse the date and subtract the epoch:

For quick, no-code conversions, you can use an online tool like the Epoch Converter or reference the time format reference.

Milliseconds vs. Seconds

While the original Unix timestamp counts seconds, many systems — particularly in web development — use milliseconds since the epoch. JavaScript's Date.now() returns a 13-digit number like 1704067200000. This provides millisecond precision, which is important for measuring short durations, ordering rapid events, and animating interfaces.

When working across systems, always check whether a timestamp is in seconds or milliseconds. Dividing a millisecond timestamp by 1000 converts it to seconds; multiplying a second timestamp by 1000 converts it to milliseconds. Confusing the two is one of the most common bugs in time-related code.

The Year 2038 Problem

The original Unix timestamp was stored as a 32-bit signed integer. The maximum value of a signed 32-bit integer is 2,147,483,647. When the clock strikes January 19, 2038 at 03:14:07 UTC, the counter will exceed this limit and overflow to -2,147,483,648, which computers will interpret as December 13, 1901.

This is the Year 2038 problem (also called Y2K38 or the Unix Epochalypse). It has the potential to affect legacy systems, embedded devices, older Linux kernels, and any software still using 32-bit time values. Consequences range from incorrect date displays to application crashes and data corruption.

The good news is that most modern operating systems and programming environments have already migrated to 64-bit integers. A signed 64-bit integer will not overflow until approximately the year 292,277,026,596 — over 292 billion years from now. The Linux kernel completed its transition to 64-bit time in version 5.6 (2020), and most other major platforms have followed suit. However, developers maintaining legacy codebases or embedded firmware should audit their systems well before 2038.

Epoch Timestamps in Different Formats

While Unix time counts seconds, other timestamp formats use different units or reference points:

Practical Tips for Working with Epoch Timestamps

Explore Related Topics

Frequently Asked Questions

What is an epoch timestamp?

An epoch timestamp is a count of seconds elapsed since a fixed reference point called an epoch. The Unix epoch is January 1, 1970 00:00:00 UTC, and a Unix timestamp is the integer number of seconds since that moment. It is the most widely used time representation in computing.

Why does Unix time start at January 1, 1970?

The Unix epoch was chosen by Ken Thompson and Dennis Ritchie around 1970 when Unix was being developed at Bell Labs. The date roughly marks the birth of Unix and was a convenient round reference point close to the start of the computing era. It was recent enough that all contemporary timestamps would be positive.

What is the Year 2038 problem?

On January 19, 2038, 32-bit signed integer Unix timestamps will overflow to a negative number, wrapping the date back to 1901. This is known as the Y2038 problem. Most modern operating systems and programming environments have migrated to 64-bit timestamps, which will not overflow for approximately 292 billion years.

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

You can convert a Unix timestamp by adding the number of seconds to the epoch. Use command-line tools like date -d @TIMESTAMP, programming languages like datetime.fromtimestamp() in Python or new Date(TIMESTAMP * 1000) in JavaScript, or online epoch converter tools.