Epoch Time
Epoch Time is also known as Unix time, Unix epoch, Unix timestamps, or POSIX time. It Is a conversion for computers to track time. Epoch time is a number of seconds since 1st January of 1970. It starts at 00:00:00 seconds on January 01, 1970.
A Coordinated Universal Time (UTC) relates to a time represented as seconds since the epoch. The date and time in a computer calculate according to the number of seconds or clock ticks that have elapsed since the defined epoch for that computer or platform.
Everywhere has the same Epoch Time
The Epoch time is time zone independent. Now we know epoch time calculates the number of seconds since 00:00:00 seconds in the midnight of January 01, 1970. And it represents UTC. Regardless of our time zone, the epoch time represents a moment that is the same everywhere.
How to calculate and keep time in computers
Computer systems include hardware devices to calculate time. These devices are based on a crystal oscillator. These devices keep working even the computer is in power off.
These are the standards for these devices.
· Programmable Interval Timer
· Real-Time Clock
· High Precision Event Timer
The computer connects them in two ways. These are,
1. When the computer boots up, the computer reads the current time from the device.
2. At regular intervals, the device builds the hardware interrupt. Causing that to use to do any time-dependent tasks.
Different types of operating systems use different time instances as their Epoch time.
Operating System and Epoch Time Initiated From
Get Hasara Ismini Biseka’s stories in your inbox
Join Medium for free to get updates from this writer.
The real world — 00:00:00 UTC
Unix and Linux systems — 01 January 1970
Microsoft Windows — 01 January 1601
Apple macOS — 01 January 1904
How to Calculate Date and Time using Epoch Time
· When calculating the days using Epoch time, the leap seconds are ignored.
· A leap second is a one-second adjustment applied to UTC time. It adds because to accommodate the difference between précis time and imprecise observed solar time. This difference occurs due to irregularities and the long-term slowdown in Earth’s rotation.
Unix Epoch Time
The Epoch timestamp was introduced by Unix operating system. The Unix timestamp was set to 00:00:00 UTC on January 1, 1970.
Following are the Unix commands to get the current time and Unix Epoch timestamp.
1. To find the current epoch timestamp (using terminal)
Date”+%s”
2. To convert Unix epoch timestamp to human-readable time. (Using Terminal)
Date –r(epoch time)
3. To get a human-readable date.
Date
Epoch Time in Java
Java uses the same epoch in Unix as the number of milliseconds since midnight of January 1st, 1970.









