I just found out, running a calendar script, that timestamps in PHP has a limit to 2038. What does it really mean? Why is it 2038 instead of 2050 or 2039? Why a limit if timestamps just count seconds from a given date (1970)?
Players of games or apps which are programmed to impose waiting periods are running into this problem when the players try to bypass the waiting period by setting the date on their devices to a date past 19 January 2038, but are unable to do so, since a 32-bit Unix time format is being used.
The Year 2038 problem is caused by an insufficient number of bits (digits) chosen to represent time. This has been known as early as 2006, when companies started to implement software with code embedded to handle a database request that should “never” time out.
Any 32-bit development that has not been updated on January 19, 2038, one of three things will happen: It will start to give errors that will generate chain failures in the system. It will shut down and stop working forever. You will reset your time count and believe you are back to 1901.
The end of time The most imminent overflow date is the 32-bit signed integer-based systems', scheduled for 19 January 2038, at 03:14:07 UTC. One second later, computers will fall back to 13 December 1901, at 20:45:52 UTC. This behavior is due to an integer overflow occurring at the time of adding the next second.
The limit is imposed by the 4 byte signed integers that most C libraries use for representing that count. Quick math (assumes 365 day years, not exactly correct):
2147483648 seconds ~ 68.1 years
This also implies a lower limit of ~1900. Some libraries have started to introduce 64 bit epoch counts, but they are few and far between for the moment.
The maximum value of a 32-bit integer is 2,147,483,647. If you add +1 to that, you get -2,147,483,647. 2,147,483,647 seconds from 01-01-1970 00:00:00 is January 19, 2038. If you add one more second, you get a date somewhere in 1902.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With