php-doc-en/reference/datetime/functions/gmmktime.xml

178 lines
4.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<refentry id="function.gmmktime">
<refnamediv>
<refname>gmmktime</refname>
<refpurpose>Get Unix timestamp for a GMT date</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>gmmktime</methodname>
<methodparam choice="opt"><type>int</type><parameter>hour</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>minute</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>month</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>year</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam>
</methodsynopsis>
<para>
Identical to <function>mktime</function> except the passed parameters represents a
GMT date. <function>gmmktime</function> internally uses <function>mktime</function>
so only times valid in derived local time can be used.
</para>
<para>
Like <function>mktime</function>, arguments may be left out in order
from right to left, with any omitted arguments being set to the
current corresponding GMT value.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>hour</parameter></term>
<listitem>
<para>
The hour
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>minute</parameter></term>
<listitem>
<para>
The minute
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>second</parameter></term>
<listitem>
<para>
The second
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>month</parameter></term>
<listitem>
<para>
The month
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>day</parameter></term>
<listitem>
<para>
The day
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>year</parameter></term>
<listitem>
<para>
The year
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>is_dst</parameter></term>
<listitem>
<para>
Parameters always represent a GMT date so <parameter>is_dst</parameter>
doesn't influence the result.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <type>integer</type> Unix timestamp.
</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.0</entry>
<entry>
As of PHP 5.1.0, the <parameter>is_dst</parameter> parameter became
deprecated. As a result, the new timezone handling features should be used
instead.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>gmmktime</function> on Windows boundary</title>
<programlisting role="php">
<![CDATA[
<?php
gmmktime(0, 0, 0, 1, 1, 1970); // valid in GMT and west, invalid in east
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mktime</function></member>
<member><function>date</function></member>
<member><function>time</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:"../../../../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
-->