timezone_to_country 2.2.1 timezone_to_country: ^2.2.1 copied to clipboard
Extension method for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')
timezone_to_country #
Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul'
to 'KR'
)
Usage #
TimeZoneToCountry.getCountryCode('Asia/Seoul') // 'KR'
TimeZoneToCountry.getCountryCode('America/Los_Angeles') // 'US'
TimeZoneToCountry.getCountryCode('Europe/London') // 'GB'
String code = await TimeZoneToCountry.getLocalCountryCode();
print(code); // 'KR'
Source of Time Zone #
IANA - Time Zone Database - 2024a