<?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 class="union"><type>int</type><type>null</type></type><parameter>timestamp</parameter><initializer>&null;</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.
  </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>8.0.0</entry>
       <entry>
        <parameter>timestamp</parameter> is nullable now.
       </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><methodname>DateTimeImmutable::__construct</methodname></member>
    <member><methodname>DateTimeInterface::format</methodname></member>
    <member><function>date</function></member>
    <member><function>mktime</function></member>
    <member><function>gmmktime</function></member>
    <member><methodname>IntlDateFormatter::format</methodname></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
-->
