File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,27 @@ to the current default locale::
335
335
$currencies = Intl::getCurrencyBundle()->getCurrencyNames('de');
336
336
// => array('AFN' => 'Afghanische Afghani', ...)
337
337
338
+ Timezones
339
+ ~~~~~~~~~
340
+
341
+ The translations of timezone names can be found in the timezone bundle::
342
+
343
+ use Symfony\Component\Intl\Intl;
344
+
345
+ \Locale::setDefault('en');
346
+
347
+ $timezones = Intl::getTimezoneBundle()->getTimezoneNames();
348
+ // => array('Africa/Abidjan' => 'Abidjan', ...)
349
+
350
+ $timezone = Intl::getTimezoneBundle()->getTimezoneName('America/St_Barthelemy');
351
+ // => 'St. Barthélemy'
352
+
353
+ All methods accept the translation locale as the last, optional parameter,
354
+ which defaults to the current default locale::
355
+
356
+ $timezones = Intl::getTimezoneBundle()->getTimezoneNames('de');
357
+ // => array('Africa/Abidjan' => 'Abidjan', ...)
358
+
338
359
That's all you need to know for now. Have fun coding!
339
360
340
361
.. _Packagist : https://packagist.org/packages/symfony/intl
You can’t perform that action at this time.
0 commit comments