<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="function.gmdate" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>gmdate</refname> <refpurpose>Format a GMT/UTC date/time</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>gmdate</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timestamp</parameter><initializer>time()</initializer></methodparam> </methodsynopsis> <para> Identical to the <function>date</function> function except that the time returned is Greenwich Mean Time (GMT). </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>format</parameter></term> <listitem> <para> The format of the outputted date <type>string</type>. See the formatting options for the <function>date</function> function. </para> </listitem> </varlistentry> &date.timestamp.description; </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a formatted date string. If a non-numeric value is used for <parameter>timestamp</parameter>, &false; is returned and an <constant>E_WARNING</constant> level error is emitted. </para> </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.1.1</entry> <entry> There are useful <link linkend="datetime.constants">constants</link> of standard date/time formats that can be used to specify the <parameter>format</parameter> parameter. </entry> </row> <row> <entry>5.1.0</entry> <entry> The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows). </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>gmdate</function> example</title> <para> When run in Finland (GMT +0200), the first line below prints "Jan 01 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00". </para> <programlisting role="php"> <![CDATA[ <?php echo date("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998)); echo gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998)); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>date</function></member> <member><function>mktime</function></member> <member><function>gmmktime</function></member> <member><function>strftime</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->