php-doc-en/reference/datetime/functions/gmdate.xml
2003-12-15 16:55:22 +00:00

79 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.gmdate">
<refnamediv>
<refname>gmdate</refname>
<refpurpose>Format a GMT/UTC date/time</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>gmdate</methodname>
<methodparam><type>string</type><parameter>format</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam>
</methodsynopsis>
<para>
Identical to the <function>date</function> function except that
the time returned is Greenwich Mean Time (GMT). For example, 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".
<example>
<title><function>gmdate</function> example</title>
<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>
<note>
<para>
In the Microsoft Windows series of Operating Systems the system
libraries implementing this function are broken, so
<function>gmdate</function> does not support negative values
for the <parameter>timestamp</parameter>.
For details see bug reports:
<ulink url="&url.php.bugs;22620">#22620</ulink>,
<ulink url="&url.php.bugs;22457">#22457</ulink>,
and <ulink url="&url.php.bugs;14391">#14391</ulink>.
</para>
<para>
This problem does not occur in Unix/Linux Operating Systems, as the
system libraries behave as expected.
</para>
<para>
PHP cannot fix broken system libraries. Contact
your OS vendor for a fix to this and similar problems.
</para>
</note>
<para>
See also <function>date</function>, <function>mktime</function>,
<function>gmmktime</function> and <function>strftime</function>.
</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:"../../../../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
-->