This library converts different timezone strings.
use Ixnode\PhpTimezone\Timezone;
print (new Timezone('Europe/Berlin'))->getCountryCode();
// (string) "DE"
print (new Timezone('Europe/Berlin'))->getCountryName();
// (string) "Germany"
use Ixnode\PhpTimezone\Constants\Locale
print (new Timezone('Europe/Berlin'))->getCountryName(Locale::DE_DE);
// (string) "Deutschland"
use Ixnode\PhpTimezone\Constants\Locale
use Ixnode\PhpTimezone\Constants\LocaleTranslation
print LocaleTranslation::DE_DE[Locale::DE_DE];
// (string) "Deutsch (Deutschland)"
print LocaleTranslation::DE_DE[Locale::ES_ES];
// (string) "Alemán (Alemania)"
print LocaleTranslation::NN_NO[Locale::IT_IT];
// (string) "Norvegese nynorsk (Norvegia)"
etc.
use Ixnode\PhpTimezone\Constants\Language
print Language::DE['de'];
// (string) "Deutsch"
print Language::DE['sv'];
// (string) "Tyska"
print Language::SV['en'];
// (string) "Swedish"
etc.
composer require ixnode/php-timezone
vendor/bin/php-timezone -V
php-timezone 0.1.0 (12-19-2022 01:17:26) - Björn Hempel <bjoern@hempel.li>
git clone git@github.com:ixnode/php-timezone.git && cd php-timezone
composer install
composer test
This tool is licensed under the MIT License - see the LICENSE file for details