note 70838 deleted from function.mktime by derick
| From: | derick@php.net | Date: | Sat, 26 Jul 2008 10:03:38 +0000 |
| Subject: | note 70838 deleted from function.mktime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142769@lists.php.net to get a copy of this message | ||
Note Submitter: php at jaggard dot org dot uk
----
As I see it, this function should default to zero for the first 3 arguments but one for the next
two.
It makes sense to talk about the 0th hour of the day (midnight) or the 0th minute of the hour or the
0th second of the minute, but it makes no sense to talk about the 0th day of the month or the 0th
month of the year.
The example of why this change should happen is below:
<select id="month" name="month">
<?php
for ($i = 1; $i <= 12; $i++)
echo '<option
value="'.$i.'">'.date('F',mktime(0,0,0,$i)).'</option>';
?>
</select>
Produces a list of meaningless months. To make it useful, you have to add an extra argument to
mktime.
<?php
mktime(0,0,0,$i,1)
?>