mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 18:02:17 +01:00
233 lines
6.4 KiB
XML
233 lines
6.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: ceedf4c5240cf79ea24baa7f2fcffa312aaccda3 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="datetimezone.gettransitions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>DateTimeZone::getTransitions</refname>
|
|
<refname>timezone_transitions_get</refname>
|
|
<refpurpose>Retourne toutes les transitions d'un fuseau horaire</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<para>&style.oop;</para>
|
|
<methodsynopsis role="oop">
|
|
<modifier>public</modifier> <type class="union"><type>array</type><type>false</type></type><methodname>DateTimeZone::getTransitions</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>timestampBegin</parameter><initializer><constant>PHP_INT_MIN</constant></initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>timestampEnd</parameter><initializer><constant>PHP_INT_MAX</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>&style.procedural;</para>
|
|
<methodsynopsis role="procedural">
|
|
<type class="union"><type>array</type><type>false</type></type><methodname>timezone_transitions_get</methodname>
|
|
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>timestampBegin</parameter><initializer><constant>PHP_INT_MIN</constant></initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>timestampEnd</parameter><initializer><constant>PHP_INT_MAX</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&date.datetimezone.description;
|
|
<varlistentry>
|
|
<term><parameter>timestampBegin</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Début du timestamp.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>timestampEnd</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Fin du timestamp.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne un tableau indexé numériquement des tableaux
|
|
de transition en cas de succès, &return.falseforfailure;.
|
|
Les objets DateTimeZone enveloppant des fuseaux de type 1 (décalage UTC)
|
|
et type 2 (abréviations) ne contiennent pas des transitions et appelé
|
|
cette méthode sur eux retournera &false;.
|
|
</para>
|
|
<para>
|
|
Si <parameter>timestampBegin</parameter> est fournit, la première entrée
|
|
dans le tableau retourné contiendra un élément de transition au temps de
|
|
<parameter>timestampBegin</parameter>.
|
|
</para>
|
|
<para>
|
|
<table>
|
|
<title>Structure des tableaux de transition</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Clé</entry>
|
|
<entry>Type</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><literal>ts</literal></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>timestamp Unix</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>time</literal></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>Chaîne de temps <constant>DateTimeInterface::ISO8601</constant></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>offset</literal></entry>
|
|
<entry><type>int</type></entry>
|
|
<entry>Décalage horaire vers UTC en secondes</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>isdst</literal></entry>
|
|
<entry><type>bool</type></entry>
|
|
<entry>Si l'heure d'été ext activée</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>abbr</literal></entry>
|
|
<entry><type>string</type></entry>
|
|
<entry>Abréviation du fuseau horaire</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>timezone_transitions_get</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$timezone = new DateTimeZone("Europe/London");
|
|
$transitions = $timezone->getTransitions();
|
|
print_r(array_slice($transitions, 0, 3));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => Array
|
|
(
|
|
[ts] => -9223372036854775808
|
|
[time] => -292277022657-01-27T08:29:52+0000
|
|
[offset] => 3600
|
|
[isdst] => 1
|
|
[abbr] => BST
|
|
)
|
|
|
|
[1] => Array
|
|
(
|
|
[ts] => -1691964000
|
|
[time] => 1916-05-21T02:00:00+0000
|
|
[offset] => 3600
|
|
[isdst] => 1
|
|
[abbr] => BST
|
|
)
|
|
|
|
[2] => Array
|
|
(
|
|
[ts] => -1680472800
|
|
[time] => 1916-10-01T02:00:00+0000
|
|
[offset] => 0
|
|
[isdst] =>
|
|
[abbr] => GMT
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
|
|
<example>
|
|
<title>Un exemple de <function>timezone_transitions_get</function> avec
|
|
<parameter>timestampBegin</parameter> défini</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$timezone = new DateTimeZone("Europe/London");
|
|
$transitions = $timezone->getTransitions(time());
|
|
print_r(array_slice($transitions, 0, 3));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => Array
|
|
(
|
|
[ts] => 1654184161
|
|
[time] => 2022-06-02T15:36:01+0000
|
|
[offset] => 3600
|
|
[isdst] => 1
|
|
[abbr] => BST
|
|
)
|
|
|
|
[1] => Array
|
|
(
|
|
[ts] => 1667091600
|
|
[time] => 2022-10-30T01:00:00+0000
|
|
[offset] => 0
|
|
[isdst] =>
|
|
[abbr] => GMT
|
|
)
|
|
|
|
[2] => Array
|
|
(
|
|
[ts] => 1679792400
|
|
[time] => 2023-03-26T01:00:00+0000
|
|
[offset] => 3600
|
|
[isdst] => 1
|
|
[abbr] => BST
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|