Bug #3212: getdate() returns incorrect time

From: Date: Fri, 14 Jan 2000 10:48:51 +0000
Subject: Bug #3212: getdate() returns incorrect time
Groups: php.dev 
Request: Send a blank email to php-dev+get-14615@lists.php.net to get a copy of this message
From: nekhoroshkov@novoalbs.ru Operating system: Linux PHP version: 3.0.12 PHP Bug Type: Other Bug description: getdate() returns incorrect time function GetCurrentMinutes($WithZero) { $minutes=getdate(time()); $minutes=$minutes["minutes"]; if ($WithZero) { if ($minutes<10) {$minutes="0".$minutes;} } return $minutes; } function GetCurrentHours($WithZero) { $hours=getdate(time()); $hours=$hours["hours"]; if ($WithZero) { if ($hours<10) {$hours="0".$hours;} } return $hours; } $hour=GetCurrentHours(1); $min=GetCurrentMinutes(1); $min=round($min/5)*5; $time=$hour.":".$min.":00"; The function getdate () in any moment (arising very seldom) returns values 0 hours and 0 minutes accordingly I tested the given function "rolling" her(it) in cycle from 1 up to 10000. There was no error. But in substantial script The error unfortunately arises. By a variable $time the value is assigned only once. She(it) is more anywhere The variable $time is reassigned and still in any of the appeals to script receives equal 00:00:00

« previous php.dev (#14615) next »