|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone have a solution for the Y2038K bug in the mktime()/date() functions?
|
|
#2
|
|||
|
|||
|
what the heck IS the Y2038 bug in these functions? What are the symptoms?
|
|
#3
|
|||
|
|||
|
You cannot generate a date bigger than 19 Jan 2038 03:14:07 GMT
echo date("Y-m-d", mktime(0,0,0,1,1, 2002 + 60)) // year 1970..... Manual says: Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) |
|
#4
|
||||
|
||||
|
Beats me why your worryin about it, by the year 2038 you will probably be using a new version of PHP in your brain implant (like Johnie Neumonic or The Matrix)...
Though it may help to drop PHP/Zend/Whoever a note... so they know for future reference. ![]()
__________________
deepspring - "Netscape 4 users are like lemmings... You can't help but laugh when one falls off a cliff" |
|
#5
|
||||
|
||||
|
64-bit microprocessors. 2^64 = a whole lot of milliseconds.
__________________
Jon Sagara "Me fail English? That's unpossible!" |
|
#6
|
|||
|
|||
|
Because I'm writing an statistic application that must calculate over the year 2038, too....
|
|
#7
|
||||
|
||||
|
It's not a problem with PHP, I don't believe. It's a problem with Unix/Linux... I think it is limited to this because of the timestamp the string it will generate.
__________________
Matt Light Web Programmer |
|
#8
|
||||
|
||||
|
Quote:
whoa, thats a longgggg way in the future... why so far down the track? |
|
#9
|
|||
|
|||
|
Re: 2038 bug
Quote:
Write your own functions. It's that simple. These functions all depend on the timestamps(in seconds) since the Unix epoch(1-1-1970), and these will overflow above 2038. You could try finding 'algorithm 199: conversions between calendar date and Julian day number' from Communications of the ACM, which seems to be a way to fix the problem. They're probably a few implementations somewhere on the web, but I don't think you can get the original magazine anymore, it's from 1964. ![]()
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > 2038 bug |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|