Re: [PHP] dates greater than 2002-01-18 create error
It's a fairly well known problem now but I'm sure we'll all be using (at least) 64bit integers for storing this sort of stuff by 2038. FYI, the current 32bit signed int allows for around 68years - a 64bit signed int will give us a few billion years :) Danny. - Original Message - From: "John Wards" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 5:32 PM Subject: Re: [PHP] dates greater than 2002-01-18 create error > right am i missing something or is that not just an other Y2K "bug" waiting > to happen? > > Not that I plan to be coding php in 2038 but my kids might be.:-P > > John > - Original Message - > From: "Adam Voigt" <[EMAIL PROTECTED]> > To: "Jay Blanchard" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, August 12, 2002 5:26 PM > Subject: RE: [PHP] dates greater than 2002-01-18 create error > > > > Dude, did you read the PHP Date manual page? > > > > I quote: > > > > 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). On windows this range is limited from 01-01-1970 to > > 19-01-2038. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dates greater than 2002-01-18 create error
right am i missing something or is that not just an other Y2K "bug" waiting to happen? Not that I plan to be coding php in 2038 but my kids might be.:-P John - Original Message - From: "Adam Voigt" <[EMAIL PROTECTED]> To: "Jay Blanchard" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 5:26 PM Subject: RE: [PHP] dates greater than 2002-01-18 create error > Dude, did you read the PHP Date manual page? > > I quote: > > 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). On windows this range is limited from 01-01-1970 to > 19-01-2038. > > Adam Voigt > [EMAIL PROTECTED] > > On Mon, 2002-08-12 at 12:23, Jay Blanchard wrote: > > [snip] > > > $day = "2038-01-19"; > > > > $day_temp = date("d", strtotime("$day")); > > $month_temp = date("m", strtotime("$day")); > > $year_temp = date("Y", strtotime("$day")); > > $temp_date = mktime (0,0,0,$month_temp ,$day_temp+1 ,$year_temp); > > echo date ("Y-m-d", $temp_date); > > > > ?> > > [/snip] > > > > I take out '+1' and the result is 1969-12-31 > > I put in the '+1' and the result is 1970-01-01 > > > > I change '2038-01-19' to '2002-01-19' and it works. Which is what the > > subject of your message was, not [PHP] dates greater than 2038-01-18 create > > error > > > > HTH! > > > > Jay > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dates greater than 2002-01-18 create error
Dude, did you read the PHP Date manual page? I quote: 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). On windows this range is limited from 01-01-1970 to 19-01-2038. Adam Voigt [EMAIL PROTECTED] On Mon, 2002-08-12 at 12:23, Jay Blanchard wrote: > [snip] > $day = "2038-01-19"; > > $day_temp = date("d", strtotime("$day")); > $month_temp = date("m", strtotime("$day")); > $year_temp = date("Y", strtotime("$day")); > $temp_date = mktime (0,0,0,$month_temp ,$day_temp+1 ,$year_temp); > echo date ("Y-m-d", $temp_date); > > ?> > [/snip] > > I take out '+1' and the result is 1969-12-31 > I put in the '+1' and the result is 1970-01-01 > > I change '2038-01-19' to '2002-01-19' and it works. Which is what the > subject of your message was, not [PHP] dates greater than 2038-01-18 create > error > > HTH! > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dates greater than 2002-01-18 create error
[snip] [/snip] I take out '+1' and the result is 1969-12-31 I put in the '+1' and the result is 1970-01-01 I change '2038-01-19' to '2002-01-19' and it works. Which is what the subject of your message was, not [PHP] dates greater than 2038-01-18 create error HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dates greater than 2002-01-18 create error
[snip] Anytime I try to add a day to the date 2002-01-18, I get a Warning: unexpected error in date() error. Can anyone shed some light on this. [/snip] If you'll shed some code on this, we'll shed some help :^] Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php