svn: /phpdoc/en/trunk/reference/datetime/datetime/ construct.xml
| From: | Daniel Convissor | Date: | Wed, 05 May 2010 03:18:48 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/datetime/datetime/ construct.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6583@lists.php.net to get a copy of this message | ||
danielc Wed, 05 May 2010 03:18:48 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=299009
Log:
Add example of dates rolling over.
Changed paths:
U phpdoc/en/trunk/reference/datetime/datetime/construct.xml
Modified: phpdoc/en/trunk/reference/datetime/datetime/construct.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/datetime/construct.xml 2010-05-05 03:05:09 UTC (rev 299008)
+++ phpdoc/en/trunk/reference/datetime/datetime/construct.xml 2010-05-05 03:18:48 UTC (rev 299009)
@@ -139,6 +139,10 @@
// 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 @@
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>