As early as the 1970s, programmers chose a simple and convenient way to store time in operating systems — using an integer in the calculations (instead of inconvenient days, minutes, seconds) that would show how many seconds had passed since a certain date. And this date was chosen on January 1, 1970. This method has been used so far, as a result of which errors can sometimes occur. Like, for example, in the original version of the game Civilization, when Gandhi turned out to be a scum and declared war on everyone because of the reduction in the level of aggression to values below 0, when the level of aggression scrolled and sharply became maximum.
And if in 4 bits the maximum number written in binary is 15:
0000 - 0, 0001 - 1, 0010 - 2, 0011-3, ............, 1111 - 15. ')
And after 15, the value is scrolled as a result of overflowing the whole and 0 is raised again.
In the 64-bit version of the OS, this is 18.446.744.073.709.551.615 (when using 20 decimal digits) and -9.223.372.036.854.775.808 or +9.223.372.036.854.775.807 when using 19 decimal digits. And it would seem that a mistake with overflowing the whole or under-completing is hardly possible. The range is quite large and allows you to operate with huge values.
But what will happen if, on the 64-bit OS of the Iphone phone, which uses the same time tracking principles, set the time close to January 1, 1970?
That's right, there will be a rather amusing video: “How to kill an Iphone in 30 seconds”, which I recently discovered with surprise on the Internet and which has already gained millions of views:
Subsequently, a solution was found and even a little talked about the reasons:
On the Internet, they say that one of the possible system checks (calculating the time of the last call or battery operation) is most likely to blame, which results in a time earlier than January 1, 1970, not only negative, but with a value that is an order of magnitude higher the expected lifetime of our Universe, with the display of which the program, of course, has problems.