From:             sanjay dot mantoor at gmail dot com
Operating system: SUSE Linux Enterprise Server 10 
PHP version:      5.3CVS-2008-10-29 (snap)
PHP Bug Type:     Date/time related
Bug description:  getdate returns "unknown" for higher negative values

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 bug report at http://bugs.php.net/?id=46417&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46417&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46417&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46417&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46417&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46417&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46417&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46417&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46417&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46417&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46417&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46417&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46417&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46417&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46417&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46417&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46417&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46417&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46417&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46417&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46417&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46417&r=mysqlcfg

Reply via email to