svn: /phpdoc/en/trunk/reference/datetime/datetime/ gettimestamp.xml settimestamp.xml
| From: | Daniel Convissor | Date: | Thu, 29 Apr 2010 02:59:03 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/datetime/datetime/ gettimestamp.xml settimestamp.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6522@lists.php.net to get a copy of this message | ||
danielc Thu, 29 Apr 2010 02:59:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298753
Log:
Add example section.
Changed paths:
U phpdoc/en/trunk/reference/datetime/datetime/gettimestamp.xml
U phpdoc/en/trunk/reference/datetime/datetime/settimestamp.xml
Modified: phpdoc/en/trunk/reference/datetime/datetime/gettimestamp.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/datetime/gettimestamp.xml 2010-04-29 02:18:36 UTC (rev
298752)
+++ phpdoc/en/trunk/reference/datetime/datetime/gettimestamp.xml 2010-04-29 02:59:03 UTC (rev
298753)
@@ -36,6 +36,37 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><function>DateTime::getTimestamp</function> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$date = new DateTime();
+echo $date->getTimestamp();
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$date = date_create();
+echo date_timestamp_get($date);
+?>
+]]>
+ </programlisting>
+ &examples.outputs.similar;
+ <screen>
+<![CDATA[
+1272509157
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
<para>
Modified: phpdoc/en/trunk/reference/datetime/datetime/settimestamp.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/datetime/settimestamp.xml 2010-04-29 02:18:36 UTC (rev
298752)
+++ phpdoc/en/trunk/reference/datetime/datetime/settimestamp.xml 2010-04-29 02:59:03 UTC (rev
298753)
@@ -46,6 +46,44 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><function>DateTime::setTimestamp</function> example</title>
+ <para>&style.oop;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$date = new DateTime();
+echo $date->format('U = Y-m-d H:i:s') . "\n";
+
+$date->setTimestamp(1171502725);
+echo $date->format('U = Y-m-d H:i:s') . "\n";
+?>
+]]>
+ </programlisting>
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$date = date_create();
+echo date_format($date, 'U = Y-m-d H:i:s') . "\n";
+
+date_timestamp_set($date, 1171502725);
+echo date_format($date, 'U = Y-m-d H:i:s') . "\n";
+?>
+]]>
+ </programlisting>
+ &examples.outputs.similar;
+ <screen>
+<![CDATA[
+1272508903 = 2010-04-28 22:41:43
+1171502725 = 2007-02-14 20:25:25
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
<para>