note 41592 deleted from function.getdate by nlopess
| From: | nlopess@php.net | Date: | Fri, 16 Apr 2004 13:30:14 +0000 |
| Subject: | note 41592 deleted from function.getdate by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68202@lists.php.net to get a copy of this message | ||
Note Submitter: rob@webdimension.co.uk
----
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