Added reference and example of using 0 as last day of previous month

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@18475 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mike Robinson 2000-01-07 02:34:06 +00:00
parent f05dd407a9
commit 129d13b8bc

View file

@ -353,6 +353,20 @@ echo date( "M-d-Y", mktime(0,0,0,1,1,1998) );
</programlisting>
</example>
</para>
<para>
The last day of any given month can be expressed as the "0" day
of the next month, not the -1 day. Both of the following examples
will produce the string "The last day in Feb 2000 is: 29".
<example>
<programlisting>
$lastday=mktime(0,0,0,3,0,2000);
echo strftime("Last day in Feb 2000 is: %d",$lastday);
$lastday=mktime(0,0,0,4,-31,2000);
echo strftime("Last day in Feb 2000 is: %d",$lastday);
</programlisting>
</example>
</para>
<para>
See also <function>date</function> and <function>time</function>.
</para>