mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
f05dd407a9
commit
129d13b8bc
1 changed files with 14 additions and 0 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue