mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Adjust example to show excessive values rolling into parents.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@298446 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3b5eab0c4e
commit
c866af773f
1 changed files with 16 additions and 5 deletions
|
@ -90,8 +90,13 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
$date = new DateTime();
|
||||
$date->setDate(2022, 3, 4);
|
||||
echo $date->format('Y-m-d');
|
||||
|
||||
$date->setDate(2001, 2, 3);
|
||||
echo $date->format('Y-m-d') . "\n";
|
||||
|
||||
// Values exceeding ranges are added to their parent values.
|
||||
$date->setDate(2001, 14, 3);
|
||||
echo $date->format('Y-m-d') . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -102,15 +107,21 @@ echo $date->format('Y-m-d');
|
|||
<![CDATA[
|
||||
<?php
|
||||
$date = date_create();
|
||||
date_date_set($date, 2022, 3, 4);
|
||||
echo date_format($date, 'Y-m-d');
|
||||
|
||||
date_date_set($date, 2001, 2, 3);
|
||||
echo date_format($date, 'Y-m-d') . "\n";
|
||||
|
||||
// Values exceeding ranges are added to their parent values.
|
||||
date_date_set($date, 2001, 14, 3);
|
||||
echo date_format($date, 'Y-m-d') . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2022-03-04
|
||||
2001-02-03
|
||||
2002-02-03
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue