For example, I mostly program in PHP. What can I do today to prevent my program from exploding in 2038 due to unix time stamp running out? I would love to see some specific algorithms, functions or logics that can work to prevent this problem. Thanks.
One billion seconds (just over 31 years, 251 days, 1 hour, 46 minutes and 40 seconds) after 01:27:28 UTC on 13 May 2006 is beyond the 2038 cutoff date. Thus, after this time, the time-out calculation overflowed and returned a date that was actually in the past, causing the software to crash.
But if we survive that, Unix and Linux geeks know that the real end of time is waiting just around the corner: January 19, 2038, at 3:14 a.m. UTC.
2,147,483,647 – The End of Time [Unix].
Unix time is a way of representing a timestamp by representing the time as the number of seconds since January 1st, 1970 at 00:00:00 UTC. One of the primary benefits of using Unix time is that it can be represented as an integer making it easier to parse and use across different systems.
Store the timestamp as a 64bit, or higher, integer. I'm sure MySQL will be updated by then so that TIMESTAMP
isn't 32bit. In regards to PHP, I don't see any issues there if you're on a 64 bit server.
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