ID: 28281
Comment by: scottmacvicar at ntlworld dot com
Reported By: info at alt dot lt
Status: Open
Bug Type: Unknown/Other Function
Operating System: debian woody (latest stable upd)
PHP Version: 4.3.6
New Comment:
The last day of any given month can be expressed as the "0" day of the
next month, not the -1 day. Hence why 0 is producing the last day of
November.
This is in the mktime documentation.
Previous Comments:
------------------------------------------------------------------------
[2004-05-05 11:57:34] info at alt dot lt
Description:
------------
strftime prints incorret (decreased by one) month, when directed to
print only month.
Reproduce code:
---------------
<?
$month=12;
$year=2004;
$day=15;
$dat=strftime("%B",mktime(0,0,0,$month,0,0));
echo $dat,"<br>";
$dat1=strftime("%Y %B %d ",mktime(0,0,0,$month,$day,$year));
echo $dat1,"<br>";
?>
Expected result:
----------------
Result is self explaining:
November
2004 December 15
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28281&edit=1