#37189 [Fbk->Bgs]: getdate doesn't work with a parameter

From: Date: Tue, 25 Apr 2006 06:58:58 +0000
Subject: #37189 [Fbk->Bgs]: getdate doesn't work with a parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96192@lists.php.net to get a copy of this message
ID: 37189 Updated by: mike@php.net Reported By: mlandis at pnmx dot com -Status: Feedback +Status: Bogus Bug Type: Date/time related Operating System: Fedora Core 4 PHP Version: 5.1.2 New Comment: Oh, you've got a typo: $timestamp != $timeStamp. Previous Comments: ------------------------------------------------------------------------ [2006-04-25 06:56:39] mike@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip Not reproducible. ------------------------------------------------------------------------ [2006-04-25 04:45:14] mlandis at pnmx dot com 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 this bug report at http://bugs.php.net/?id=37189&edit=1

« previous php.bugs (#96192) next »