Add example of dates rolling over.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@299009 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Convissor 2010-05-05 03:18:48 +00:00
parent 0e209aff72
commit 87775dd402

View file

@ -139,6 +139,10 @@ echo $date->format('Y-m-d H:i:sP') . "\n";
// Using a UNIX timestamp. Notice the result is in the UTC time zone.
$date = new DateTime('@946684800');
echo $date->format('Y-m-d H:i:sP') . "\n";
// Non-existant values roll over.
$date = new DateTime('2000-02-30');
echo $date->format('Y-m-d H:i:sP') . "\n";
?>
]]>
</programlisting>
@ -150,6 +154,7 @@ echo $date->format('Y-m-d H:i:sP') . "\n";
2010-04-24 10:24:16-04:00
2010-04-25 02:24:16+12:00
2000-01-01 00:00:00+00:00
2000-03-01 00:00:00-05:00
]]>
</screen>
</example>