timezone_to_country 3.0.0 copy "timezone_to_country: ^3.0.0" to clipboard
timezone_to_country: ^3.0.0 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 #

pub package pub points device_info_plus

Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')

example

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 - 2024b

10
likes
160
points
5.69k
downloads

Publisher

unverified uploader

Weekly Downloads

Extension method for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_timezone, timezone

More

Packages that depend on timezone_to_country