[PHP] RE: [PHP-WIN] Bug in mktime-function ?
> This is the output I get running 4.0.4pl1 or 3.0.17 on Win98/Apache > Using 3/9/1935 > Unix timestamp for this date is -1 This is what I get: Using 3/9/1935 Unix timestamp for this date is -1098727200 Reconverting... March 09, 1935 > Warning: unexpected error in date() in on line 13 > Reconverting... > What platform r u using? Unix/Apache. Right now, we are using PHP Version 4.0.3pl1, but this code worked even as far back as version 3.0.5 (which is what we were using before we upgraded to 4.x). Chris
[PHP] RE: [PHP-WIN] Bug in mktime-function ?
RE: [PHP-WIN] Bug in mktime-function ?This is the output I get running 4.0.4pl1 or 3.0.17 on Win98/Apache Using 3/9/1935 Unix timestamp for this date is -1 Warning: unexpected error in date() in c:\inetpub\wwwdev\staffroot\myscu\date.php on line 13 Reconverting... What platform r u using? Ignatius -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Friday, 16 February 2001 02:16 To: 'Ignatius Teo' Cc: Php (E-mail) Subject: RE: [PHP-WIN] Bug in mktime-function ? > Therefore any date on or before 1 Jan 1970 ain't going to > work using mktime or any PHP function which returns a > UNIX timestamp. I'm sorry, but this is wrong. The following works with no problems whatsoever. $month = 3; $day = 9; $year = 1935; echo "Using $month/$day/$year
\n"; $oldDate = mktime( 0, 0, 0, $month, $day, $year ); echo "Unix timestamp for this date is $oldDate
\n"; echo "Reconverting... " . date( "F d, Y", $oldDate ); Chris
[PHP] RE: [PHP-WIN] Bug in mktime-function ?
> Therefore any date on or before 1 Jan 1970 ain't going to > work using mktime or any PHP function which returns a > UNIX timestamp. I'm sorry, but this is wrong. The following works with no problems whatsoever. $month = 3; $day = 9; $year = 1935; echo "Using $month/$day/$year
\n"; $oldDate = mktime( 0, 0, 0, $month, $day, $year ); echo "Unix timestamp for this date is $oldDate
\n"; echo "Reconverting... " . date( "F d, Y", $oldDate ); Chris