svn: /phpdoc/en/trunk/reference/datetime/datetime/ diff.xml
| From: | Daniel Convissor | Date: | Mon, 19 Apr 2010 16:32:10 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/datetime/datetime/ diff.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6395@lists.php.net to get a copy of this message | ||
danielc Mon, 19 Apr 2010 16:32:10 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298177
Log:
Add example and see also.
Changed paths:
U phpdoc/en/trunk/reference/datetime/datetime/diff.xml
Modified: phpdoc/en/trunk/reference/datetime/datetime/diff.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/datetime/diff.xml 2010-04-19 16:28:31 UTC (rev 298176)
+++ phpdoc/en/trunk/reference/datetime/datetime/diff.xml 2010-04-19 16:32:10 UTC (rev 298177)
@@ -50,6 +50,44 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>date_diff</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$first = new DateTime('2009-10-11');
+$second = new DateTime('2009-10-13');
+$interval = $first->diff($second);
+echo $interval->format('%R%d days');
+
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
++2 days
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>DateInterval::format</function></member>
+ <member><function>DateTime::add</function></member>
+ <member><function>DateTime::sub</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file