The Y2K38 Bug
The Y2K38 Bug (also known as the Unix Millennium Bug), affects PHP and several other languages, such as Perl, Ruby or Python, and systems, such as those running on Unix and Macintosh computers, which use a signed 32-bit integer to represent dates as the number of seconds since 00:00:00 UTC on 1 January 1970. The furthest date which can be stored is 03:14:07 UTC on 19 January 2038. Beyond that, the left-most bit is set and the integer becomes a negative decimal number, or a time prior to that date.
Although the count-down is still 28 years away and most programs will only be affected on 2038 or close to it, other software that work with future dates will begin developing glitches much earlier. For example, a program that works with dates 20 years in the future will have to be fixed no later than 2018.
There have been some problems of that kind already, such as the software running on a AOL server that was designed with a kludge to handle a database request that should “never” time out specified an arbitrary time-out date in the future. The default configuration for the server specified that the request should time out after one billion seconds. One billion seconds (approximately thirty-two years) after 9:27.28 pm on 12 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. When the problem was discovered, AOL’s server managers had to edit the configuration file and set the time out to a lower value
Probably, if you’re using a 64-bit OS with a compiled 64-bit edition of PHP, your application shouldn’t be affected. A signed 64-bit number gives a maximum future date which is 21 times greater than the current age of the universe, approximately 292 billion years from now, on Sunday, 4 December 292,277,026,596 CE.
More Information:
The Year 2038 Bug Site
y2038 Project Hosting on Google
Peter Gibbons
Joanna:
So, where do you work, Peter?
Peter Gibbons:
Initech.
Joanna:
In… yeah, what do you do there?
Peter Gibbons:
I sit in a cubicle and I update bank software for the 2000 switch.
Joanna:
What’s that?
Peter Gibbons:
Well see, they wrote all this bank software, and, uh, to save space, they used two digits for the date instead of four. So, like, 98 instead of 1998? Uh, so I go through these thousands of lines of code and, uh… it doesn’t really matter. I uh, I don’t like my job, and, uh, I don’t think I’m gonna go anymore.
Joanna:
You’re just not gonna go?
Peter Gibbons:
Yeah.
Joanna:
Won’t you get fired?
Peter Gibbons:
I don’t know, but I really don’t like it, and, uh, I’m not gonna go.
Joanna:
So you’re gonna quit?
Peter Gibbons:
Nuh-uh. Not really. Uh… I’m just gonna stop going.
Joanna:
When did you decide all that?
Peter Gibbons:
About an hour ago.
Joanna:
Oh, really? About an hour ago… so you’re gonna get another job?
Peter Gibbons:
I don’t think I’d like another job.
Joanna:
Well, what are you going to do about money and bills and…
Peter Gibbons:
You know, I’ve never really liked paying bills. I don’t think I’m gonna do that, either.
Joanna:
Well, so what do you wanna do?
Peter Gibbons:
I wanna take you out to dinner, and then I wanna go back to my apartment and watch ‘Kung Fu’. Do you ever watch ‘Kung Fu’?
Joanna:
I love ‘Kung Fu’.
Peter Gibbons:
Channel 39.
Joanna:
Totally.
Peter Gibbons:
You should come over and watch ‘Kung Fu’ tonight.
Joanna:
Ok.
[Peter nods]
Joanna:
Ok. Can we order lunch first?
[Peter nods again]
Joanna:
Ok.
Rick McKnight
Humm,
not sure what’s your point though …
Tom Volts
Cheers mate, very good post!