cvs: phpdoc /en/reference/datetime/functions mktime.xml
| From: | Peter Cowburn | Date: | Mon, 15 Jun 2009 11:54:46 +0000 |
| Subject: | cvs: phpdoc /en/reference/datetime/functions mktime.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4149@lists.php.net to get a copy of this message | ||
salathe Mon Jun 15 11:54:46 2009 UTC
Modified files:
/phpdoc/en/reference/datetime/functions mktime.xml
Log:
Added basic (no auto-correction, month wrapping) usage example for mktime
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/datetime/functions/mktime.xml?r1=1.29&r2=1.30&diff_format=u
Index: phpdoc/en/reference/datetime/functions/mktime.xml
diff -u phpdoc/en/reference/datetime/functions/mktime.xml:1.29
phpdoc/en/reference/datetime/functions/mktime.xml:1.30
--- phpdoc/en/reference/datetime/functions/mktime.xml:1.29 Fri Jan 16 15:36:27 2009
+++ phpdoc/en/reference/datetime/functions/mktime.xml Mon Jun 15 11:54:46 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.29 $ -->
+<!-- $Revision: 1.30 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry xml:id="function.mktime" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
@@ -174,6 +174,24 @@
&reftitle.examples;
<para>
<example>
+ <title><function>mktime</function> basic example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// Set the default timezone to use. Available as of PHP 5.1
+date_default_timezone_set('UTC');
+
+// Prints: July 1, 2000 is on a Saturday
+echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
+
+// Prints something like: 2006-04-05T01:02:03+00:00
+echo date('c', mktime(1, 2, 3, 4, 5, 2006));
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ <example>
<title><function>mktime</function> example</title>
<para>
<function>mktime</function> is useful for doing date arithmetic