ID: 46417
Updated by: [EMAIL PROTECTED]
Reported By: sanjay dot mantoor at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: SUSE Linux Enterprise Server 10
PHP Version: 5.3CVS-2008-10-29 (snap)
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2008-10-29 10:18:01] sanjay dot mantoor at gmail dot com
Description:
------------
getdate function returns wrong "weekday" for higher negative timestamps
like -12.3456789000e10. This is observed on linux 64 bit with both
php5.2 and php5.3 release.
As per documentation "weekday" should be "Sunday through Saturday".
But in this case it returns "Unknown" value.
Checked with php version
PHP 5.3.0alpha3-dev (cli) (built: Oct 29 2008 15:20:01)
Reproduce code:
---------------
<?php
$timestamp=-12.3456789000e10;
var_dump( getdate($timestamp) );
?>
Expected result:
----------------
array(11) {
["seconds"]=>
int(20)
["minutes"]=>
int(23)
["hours"]=>
int(5)
["mday"]=>
int(23)
["wday"]=>
int(-4)
["mon"]=>
int(10)
["year"]=>
int(-1943)
["yday"]=>
int(295)
["weekday"]=>
string(7) "Monday"
["month"]=>
string(7) "October"
[0]=>
int(-123456789000)
}
Actual result:
--------------
array(11) {
["seconds"]=>
int(20)
["minutes"]=>
int(23)
["hours"]=>
int(5)
["mday"]=>
int(23)
["wday"]=>
int(-4)
["mon"]=>
int(10)
["year"]=>
int(-1943)
["yday"]=>
int(295)
["weekday"]=>
string(7) "Unknown"
["month"]=>
string(7) "October"
[0]=>
int(-123456789000)
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46417&edit=1