Computers can interpret only 1s and 0s, making it a bit complicated to interpret dates in terms of year, month and day. Scientists came up with a solution to help computers understand dates: provide the date to the computer as a numerical value in terms of seconds and teach it to interpret that value as a human-readable date. This seconds value will be calculated by picking a point of reference and counting the number of seconds elapsed since that point. This is what Epoch Time is about.
Introducing Epoch Time
In the English dictionary, “Epoch” is defined as an instant of time considered to be the starting point for a particular period or event. In Computing, “Epoch Time” refers the starting point used to calculate the number of seconds elapsed.
Epoch Time in Common Operating Systems
Epoch Time in the real world starts at the time of 00:00:00 UTC, where UTC stands for Coordinated Universal Time.
Apple macOS considers its Epoch Time as starting from January 1, 1904.
Microsoft Windows considers its Epoch Time as starting from January 1, 1601.
Unix and Linux Systems consider their Epoch Time as starting from January 1, 1970. This time is also referred to as Unix Time and Unix Epoch.
What Will Unix Time Be at this Moment?
date command can be used to find the unix time at any moment, as shown below.
The large numerical value is the number of seconds elapsed since 00:00:00 UTC January 1, 1970. To interpret this date as a human, it can be fed as input again to the
date command as shown below.
To keep it simple, by default, the
date command displays a human-readable date and time along with time zone information.
Who Decided the Unix Time?
In the 1960s and 1970s, Dennis Ritchie and Ken Thompson built the Unix system together. They decided to set 00:00:00 UTC January 1, 1970, as the “epoch” moment for Unix systems.
How Effective Is Unix Time?
Unix Time is stored as a 32-bit signed integer value. As every second ticks away, the value keeps increasing, and it will eventually reach its limitation on 03:14:07, 19 January 2038 as the 32-bit signed integer value will overflow and reset itself to December 13, 1901. When this happens, it will disrupt numerous time-bound activities on a system like software licenses, backup operations, etc. This issue is referred to as “Year 2038 problem.”
Some people suggested the 32-bit value should be changed to an unsigned integer value. This meant Unix systems would be able to interpret dates up to the year 2106. However, this was found to not be effective for dates prior to 1970.
New Way to Store Unix Time
Developers soon came up with a 64-bit signed integer value to store Unix time. This means Unix time will be valid for approximately the next 14 billion years.
This is nearly 22 times greater than the current estimated age of the universe! This should last to the end of the universe (estimated to be 13.8 billion years) Newer 64-bit systems can handle the new Unix time but not older 32-bit systems. The Linux kernel introduced this 64-bit value to store the number of elapsed seconds since the epoch from version 2.6.19.
By the year 2038, it is believed that 32-bit systems will be out of vogue, so this should not be a problem. Embedded systems used in cars like Engine Control Unit (ECU) are time-dependent and 32-bit based. This is expected to work until the year 2038.
A similar situation was observed with Psy’s Gangnam Style music video uploaded on YouTube, that previously used a 32-bit value to track the number of views for a video. That video garnered so many views that it crossed the 32-bit threshold. YouTube has since begun using a 64-bit value to track the view count for its videos, stating they did not expect the number of views for a video to cross the 32-bit value.
Our latest tutorials delivered straight to your inbox