note 41592 added to function.getdate

From: Date: Thu, 15 Apr 2004 21:13:03 +0000
Subject: note 41592 added to function.getdate
Groups: php.notes 
Request: Send a blank email to php-notes+get-68178@lists.php.net to get a copy of this message
In the example above I believe the minutes and seconds has a slight error. Existing: if ($current["minutes"] < 10) { $current["minutes"] = "0" . $current["minutes"]; } if ($current["seconds"] < 10) { $current["seconds"] = "0" . $current["seconds"]; } It seems that with getdate() minutes and seconds currently have a value with a leading zero by default if < 10 This was hard to spot but I was appending an uploaded file with the minutes and seconds but the new file name kept having a double zero if the minutes and seconds were under 10 If you need the hours in 09 format you still need a < 10 test as getdate() uses a 24hr clock ---- Manual Page -- http://www.php.net/manual/en/function.getdate.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41592 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41592&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41592&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68178) next »