#37189 [NEW]: getdate doesn't work with a parameter

From: Date: Tue, 25 Apr 2006 04:45:14 +0000
Subject: #37189 [NEW]: getdate doesn't work with a parameter
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96188@lists.php.net to get a copy of this message
From: mlandis at pnmx dot com Operating system: Fedora Core 4 PHP version: 5.1.2 PHP Bug Type: Date/time related Bug description: getdate doesn't work with a parameter Description: ------------ Although getdate() works great without a parameter, it always produces: Array ( [seconds] => 0 [minutes] => 0 [hours] => 18 [mday] => 31 [wday] => 3 [mon] => 12 [year] => 1969 [yday] => 364 [weekday] => Wednesday [month] => December [0] => 0 ) when given a parameter. This PHP installation was configured with: --with-pear --with-mysql --enable-safe-mode --enable-sockets --with-apxs2=... Reproduce code: --------------- // create a timestamp close to current time $timeStamp = mktime( 23, 16, 52, 4, 24, 2006 ); echo "$timeStamp<br>\r\n"; $arr = getdate( $timestamp ); print_r( $arr ); Expected result: ---------------- something much closer to what you'd get without a parameter, e.g. Array ( [seconds] => 16 [minutes] => 31 [hours] => 23 [mday] => 24 [wday] => 1 [mon] => 4 [year] => 2006 [yday] => 113 [weekday] => Monday [month] => April [0] => 1145939476 ) Actual result: -------------- Array ( [seconds] => 0 [minutes] => 0 [hours] => 18 [mday] => 31 [wday] => 3 [mon] => 12 [year] => 1969 [yday] => 364 [weekday] => Wednesday [month] => December [0] => 0 ) -- Edit bug report at http://bugs.php.net/?id=37189&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37189&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37189&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37189&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37189&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37189&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37189&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37189&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37189&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37189&r=support Expected behavior: http://bugs.php.net/fix.php?id=37189&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37189&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37189&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37189&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37189&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37189&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37189&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37189&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37189&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37189&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37189&r=mysqlcfg

« previous php.bugs (#96188) next »