The Epoch time or the Unix time in computer science is the number of seconds since January 1, 1970.
This point in time is the same regardless of where you are on the globe.
What Is Epoch Time in Computer Science
To track the time, the computer needs to know from where to start.
The Epoch time is a popular convention for computers to track the time. The Epoch time starts at 00:00:00 Thu 01 Jan 1970 UTC and is measured in seconds. The Epoch time is thus the number of seconds since Epoch zero.
Notice that this is not the only Epoch there is. Other common Epochs are:
- 1st Jan 1900 used by Microsoft Excel.
- 1st Jan 2001 used by Apple’s Cocoa framework.
In this article, the Epoch refers to the Unix Epoch on 01/01/1970.
Why Do We Need the Epoch
If you count something, that something needs to have a starting point.
For example, if you want to know the height of a building, you need to specify the zero point for the height. It can be the ground floor, it could be the sea level. Nevertheless, not setting a zero point makes it impossible for you to know the height.
The same applies to time. A computer cannot just add seconds on top of an unspecified point in time. It needs to have a zero point.
It was decided by Unix developers that Jan 1st, 1970 midnight becomes the zero point in time for Unix operating systems.
The Epoch time (or Unix timestamp) is the number of seconds since the Epoch.
Why Does Unix Epoch Time Start at 1970
Unix system was developed between years 1969 and 1971. The first internal manual was released in 1971.
These early versions of Unix 32-bit systems could represent a time span of only 829 days. (This was because time was measured in 1/60th seconds intervals). Due to this constraint, the zero point in time had to be chosen from the recent past.
This decision was made around the year 1971 during the development of Unix. Thus, they decided to set the Epoch first on 01/01/1971.
Later on, the Unix system began to measure time in 1-second intervals. Thus the representable timespan went from 829 days to around 136 years. As a result, the Epoch needed not to be in that recent past anymore.
The Epoch was moved to the beginning of the decade on 01/01/1970, for convenience reasons.
Problems with Unix Epoch Time
Epoch time is a big number. Currently, it is more than 1.6 billion.
Many computers operate on 32 bits. This means the largest (signed) number that can be represented by such a system is
231-1. This number evaluates to
Now, if you take a look at the current Epoch time, it is (at the time of writing)
1,631,274,259 and counting. Compare this to the maximum number that can be represented with a 32-bit system. You can see the Epoch time is closing in.
As it turns out, the Epoch time will surpass the maximum number that can be understood by a 32-bit system by January 19th 2038.
More specifically, at 03:14:08 UTC on Tue, 19 Jan 2038, 32-bit versions of the Epoch time will stop working. This is because the Epoch time becomes a too big number to be represented by a 32-bit signed number.
Before this, any software using 32-bit timestamps needs to be updated to a new convention. Also, file formats using 32-bit timestamps need to be updated. One way to do this is by migrating the 32-bit systems to 64-bit ones. This moves the problem billions of years into the future.
If the updates are not made, the next second after 03:14:08 UTC on Tue, 19 Jan 2038 will be falsely interpreted as 20:45:52 Fri 13 Dec 1901 UTC.
This problem is called the Year 2038 problem in computer science.
Epoch time (also known as the Unix time) is the number of seconds elapsed since 01/01/1970. It is widely used among Unix-like operating systems.
A computer cannot add seconds on top of an unspecified value. They need to know where to start. Epochs define the zero point in time for computers.
As Unix was developed between 1969 and 1971, they placed the Epoch at the beginning of the decade 1970 for convenience.
The problem with the 1970 Epoch is that 32-bit systems cannot understand Epoch time after 19 Jan 2038. This is because the number of seconds becomes too great. To overcome this issue, the systems need to be updated before that point in time.