About UNIX timestamp

The timestamp is the number of seconds since January 1, 1970 (00:00:00 GMT). It is also known as UNIX timestamp.
UNIX timestamp, or UNIX time or POSIX time, is a time representation, defined as the total number of seconds from 00:00:00 on January 1, 1970, Greenwich mean time to the present. UNIX timestamp is not only used in UNIX systems, UNIX like systems, but also widely used in many other operating systems.
Today, we are going to discuss a very interesting thing. You know why the computer time and the time of many programming languages should be counted from January 1, 1970. Why is the starting point of time counting on January 1, 1970? I think everyone should know, but I guess most of you haven’t thought about it. Let’s talk together. Why?
1. The laziest explanation
Many programming languages originated from the UNIX system. The UNIX system thinks that 0:00 on January 1, 1970 is a time era, so we often say that the UNIX timestamp takes 0:00 on January 1, 1970 as the starting time.
Having said the lazy man’s explanation, it is estimated that we have not yet understood the real meaning. So let’s take a closer look.
2. In depth understanding
At first, the computer operating system was 32 bits, and the time was also expressed in 32 bits.
Integer is represented by 32 bits in Java, so the maximum value that 32 bits can represent is 2147483647. In addition, the total number of seconds for 365 days in a year is 31536002147483647/31536000 = 68.1, that is, the longest time that 32 bits can represent is 68 years. Since 1970, when 68.1 is added, the maximum time will finally be reached at 03:14:07 on January 19, 2038. After this time point, the time of all 32-bit operating systems will become 1000000000000000000000000, that is, 20:45:52 on December 13, 1901, In this way, the phenomenon of time regression will occur, and many software will run abnormally.
Here, I think the answer to the question has been revealed, that is, because the maximum interval of time represented by 32 bits is 68 years, and the earliest UNIX operating system takes January 1, 1970 as the era time (start time) of UNIX time in consideration of the age of the computer and the time limit of the application. As for the phenomenon of time regression, I believe that it will be gradually solved with the emergence of 64 as the operating system, Because the 64 bit operating system can show that it will be 15:30:08 on December 4, 292277026, 1996. It is believed that our descendants of N generation will not have to worry about enough even on the day the earth is destroyed, because this time is hundreds of billions of years later.

Recommended Today

How to write an avatar component with ripple effect by using react

Author: stony Chen Take a look at the final effect first, as shown in the following figure: We refer to the component effect and stylehttps://v4.mui.com/components…However, component properties are somewhat different from material UI. In addition, we also made an additional ripple effect surrounded by avatar components. List of components and attributes to be completed: Step […]