Patch DateTimeRelativeTime for Date/time related Bug #54516
Patch version 2011-04-13 00:44 UTC
Return to Bug #54516 |
Download this patch
Patch Revisions:
Developer: theanomaly.is@gmail.com
--- add.xml 2010-05-18 15:04:16.000000000 -0400
+++ add.xml.new 2011-04-12 18:48:33.000000000 -0400
@@ -1,4 +1,35 @@
-<?xml version="1.0" encoding="utf-8"?>
+
+<refsect1 role="examples"><!-- {{{ -->
+&reftitle.examples;
+<para>
+<example xml:id="function-name.example.basic"><!-- {{{ -->
+<title><function>function-name</function> example</title>
+<para>
+Any text that describes the purpose of the example, or what
+goes on in the example should be here. (Inside the <example> tag, not out).
+</para>
+<programlisting role="php">
+<![CDATA[
+<?php
+if ($anexample === true) {
+echo 'Use the PEAR Coding standards';
+}
+if ($thereisoutput === 'and it is multiple lines') {
+echo 'Use a screen like we did below';
+}
+?>
+]]>
+</programlisting>
+&example.outputs.similar;
+<screen>
+<![CDATA[
+Use the PEAR Coding standards
+Use a screen like we did below
+]]>
+</screen>
+</example><!-- }}} -->
+</para>
+</refsect1><!-- }}} --><?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 299461 $ -->
<refentry xml:id="datetime.add" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -131,6 +162,28 @@
]]>
</screen>
</example>
+ <example>
+ <title>Using relative time formats</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $date = new DateTime('4/29/1984');
+ $date->add(new DateInterval('P1D'));
+ echo $date->format('m/d/Y') . "\n";
+
+ $date->modify('first day of this month'); // Time is still relative to the existing DateTime object
+ echo $date->format('m/d/Y') . "\n";
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+04/30/1984
+04/01/1984
+]]>
+ </screen>
+ </example>
</refsect1>
<refsect1 role="notes">
|