Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/intl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,27 @@ to the current default locale::
$currencies = Intl::getCurrencyBundle()->getCurrencyNames('de');
// => array('AFN' => 'Afghanische Afghani', ...)

Timezones
~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version added ?

The translations of timezone names can be found in the timezone bundle::

use Symfony\Component\Intl\Intl;

\Locale::setDefault('en');

$timezones = Intl::getTimezoneBundle()->getTimezoneNames();
// => array('Africa/Abidjan' => 'Abidjan', ...)

$timezone = Intl::getTimezoneBundle()->getTimezoneName('America/St_Barthelemy');
// => 'St. Barthélemy'

All methods accept the translation locale as the last, optional parameter,
which defaults to the current default locale::

$timezones = Intl::getTimezoneBundle()->getTimezoneNames('de');
// => array('Africa/Abidjan' => 'Abidjan', ...)

That's all you need to know for now. Have fun coding!

.. _Packagist: https://packagist.org/packages/symfony/intl
Expand Down