-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathlistidentifiers.xml
More file actions
264 lines (254 loc) · 8.52 KB
/
listidentifiers.xml
File metadata and controls
264 lines (254 loc) · 8.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: c142be811735a5542c8a2e4c4ed2f81e8cc3acc6 Maintainer: victor-prdh Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="datetimezone.listidentifiers" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateTimeZone::listIdentifiers</refname>
<refname>timezone_identifiers_list</refname>
<refpurpose>Retourne un tableau numérique contenant tous les identifiants de fuseaux horaires définis</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>&style.oop;</para>
<methodsynopsis role="DateTimeZone">
<modifier>public</modifier> <modifier>static</modifier> <type>array</type><methodname>DateTimeZone::listIdentifiers</methodname>
<methodparam choice="opt"><type>int</type><parameter>timezoneGroup</parameter><initializer><constant>DateTimeZone::ALL</constant></initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>countryCode</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>&style.procedural;</para>
<methodsynopsis>
<type>array</type><methodname>timezone_identifiers_list</methodname>
<methodparam choice="opt"><type>int</type><parameter>timezoneGroup</parameter><initializer><constant>DateTimeZone::ALL</constant></initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>countryCode</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<simpara>
Retourne la liste des <link xlink:href="&url.wiki.tzdb.names;">identifiants de fuseaux horaires IANA</link>.
</simpara>
<note>
<simpara>
Il est possible de détecter le fuseau horaire du client (navigateur) en JavaScript en utilisant
<link xlink:href="&url.js.intl-datetimeformat;">Intl.DateTimeFormat</link> ou
<link xlink:href="&url.js.temporal-zoneddatetime;">Temporal.ZonedDateTime</link>.
</simpara>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>timezoneGroup</parameter></term>
<listitem>
<para>
Une (ou une combinaison) des constantes de classe <classname>DateTimeZone</classname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>countryCode</parameter></term>
<listitem>
<para>
Un code de pays en deux lettres (en majuscule), compatible ISO 3166-1.
</para>
<note>
<simpara>
Cette option n'est disponible que lorsque le paramètre
<parameter>timezoneGroup</parameter> prend la valeur de
<constant>DateTimeZone::PER_COUNTRY</constant>.
</simpara>
</note>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Retourne le &array; des identificateurs des fuseaux horaires.
Seuls les éléments non obsolètes sont retournés. Pour tout obtenir,
y compris les identifiants de fuseau horaire obsolètes, utiliser
<literal>DateTimeZone::ALL_WITH_BC</literal> comme valeur pour
<parameter>timezoneGroup</parameter>.
</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>
Antérieur à cette version, &false; était retourné en cas d'échec.
</entry>
</row>
<row>
<entry>7.1.0</entry>
<entry>
<parameter>countryCode</parameter> est désormais nullable.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Lister les identifiants avec des commentaires de localisation</title>
<programlisting role="php">
<![CDATA[
<?php
$identifiers = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
foreach ($identifiers as $tzid) {
$tz = new DateTimeZone($tzid);
$comments = $tz->getLocation()['comments'];
echo $tzid . " (" . ($comments ?: 'Région entière') . ")\n";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
America/Antigua (Région entière)
America/Araguaina (Tocantins)
America/Argentina/Buenos_Aires (Buenos Aires (BA, CF))
America/Argentina/Catamarca (Catamarca (CT), Chubut (CH))
America/Argentina/Cordoba (Argentine (la plupart des régions : CB, CC, CN, ER, FM, MN, SE, SF))
// (Sortie tronquée en raison de la longueur)
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Lister les identifiants d'une région spécifique</title>
<programlisting role="php">
<![CDATA[
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers( DateTimeZone::ASIA );
for ($i=0; $i < 5; $i++) {
echo "$timezone_identifiers[$i]\n";
}
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Lister les identifiants de plusieurs régions</title>
<programlisting role="php">
<![CDATA[
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers( DateTimeZone::ASIA | DateTimeZone::PACIFIC );
echo join( ', ', $timezone_identifiers );
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Asia/Aden, Asia/Almaty, Asia/Amman, Asia/Anadyr, Asia/Aqtau, Asia/Aqtobe,
Asia/Ashgabat, Asia/Atyrau, Asia/Baghdad, Asia/Bahrain, Asia/Baku,
Asia/Bangkok, Asia/Barnaul, Asia/Beirut, Asia/Bishkek, Asia/Brunei,
Asia/Chita, Asia/Choibalsan, Asia/Colombo, Asia/Damascus, Asia/Dhaka,
Asia/Dili, Asia/Dubai, Asia/Dushanbe, Asia/Famagusta, Asia/Gaza, Asia/Hebron,
Asia/Ho_Chi_Minh, Asia/Hong_Kong, Asia/Hovd, Asia/Irkutsk, Asia/Jakarta,
Asia/Jayapura, Asia/Jerusalem, Asia/Kabul, Asia/Kamchatka, Asia/Karachi,
Asia/Kathmandu, Asia/Khandyga, Asia/Kolkata, Asia/Krasnoyarsk,
Asia/Kuala_Lumpur, Asia/Kuching, Asia/Kuwait, Asia/Macau, Asia/Magadan,
Asia/Makassar, Asia/Manila, Asia/Muscat, Asia/Nicosia, Asia/Novokuznetsk,
Asia/Novosibirsk, Asia/Omsk, Asia/Oral, Asia/Phnom_Penh, Asia/Pontianak,
Asia/Pyongyang, Asia/Qatar, Asia/Qostanay, Asia/Qyzylorda, Asia/Riyadh,
Asia/Sakhalin, Asia/Samarkand, Asia/Seoul, Asia/Shanghai, Asia/Singapore,
Asia/Srednekolymsk, Asia/Taipei, Asia/Tashkent, Asia/Tbilisi, Asia/Tehran,
Asia/Thimphu, Asia/Tokyo, Asia/Tomsk, Asia/Ulaanbaatar, Asia/Urumqi,
Asia/Ust-Nera, Asia/Vientiane, Asia/Vladivostok, Asia/Yakutsk, Asia/Yangon,
Asia/Yekaterinburg, Asia/Yerevan, Pacific/Apia, Pacific/Auckland,
Pacific/Bougainville, Pacific/Chatham, Pacific/Chuuk, Pacific/Easter,
Pacific/Efate, Pacific/Fakaofo, Pacific/Fiji, Pacific/Funafuti,
Pacific/Galapagos, Pacific/Gambier, Pacific/Guadalcanal, Pacific/Guam,
Pacific/Honolulu, Pacific/Kanton, Pacific/Kiritimati, Pacific/Kosrae,
Pacific/Kwajalein, Pacific/Majuro, Pacific/Marquesas, Pacific/Midway,
Pacific/Nauru, Pacific/Niue, Pacific/Norfolk, Pacific/Noumea,
Pacific/Pago_Pago, Pacific/Palau, Pacific/Pitcairn, Pacific/Pohnpei,
Pacific/Port_Moresby, Pacific/Rarotonga, Pacific/Saipan, Pacific/Tahiti,
Pacific/Tarawa, Pacific/Tongatapu, Pacific/Wake, Pacific/Wallis
]]>
</screen>
</example>
</para>
<para>
<example>
<title>Lister les identifiants d'un seul pays</title>
<programlisting role="php">
<![CDATA[
<?php
$timezone_identifiers = DateTimeZone::listIdentifiers( DateTimeZone::PER_COUNTRY, "UA" );
foreach( $timezone_identifiers as $identifier ) {
echo "$identifier\n";
}
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Europe/Kyiv
Europe/Simferopol
Europe/Uzhgorod
Europe/Zaporozhye
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>timezone_abbreviations_list</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:"~/.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
-->