Files
doc-fr/reference/datetime/functions/gmdate.xml
2024-05-30 23:24:21 +01:00

133 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 5c951013ca04161992efed8b86fb40f55669958e Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.gmdate" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>gmdate</refname>
<refpurpose>Formate une date/heure GMT/TUC</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>
<function>gmdate</function> est identique à la fonction
<function>date</function>, hormis le fait que le temps
retourné est GMT (<literal>Greenwich Mean Time</literal>).
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>format</parameter></term>
<listitem>
<para>
Le format de la date en sortie. Voir les options de formatage pour la fonction
<function>date</function>.
</para>
</listitem>
</varlistentry>
&date.timestamp.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Retourne une date formatée.
</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> est désormais nullable.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemple avec <function>gmdate</function></title>
<para>
Lorsque cette fonction est exécutée en Finlande (GMT0200), la première
ligne ci-dessous affichera <literal>"Jan 01 1998 00:00:00"</literal>,
tandis que la seconde affichera
<literal>"Dec 31 1997 22:00:00"</literal>.
</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
-->