Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyle-seongwoo-jun/flutter_timezone_to_country
Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')
https://github.com/kyle-seongwoo-jun/flutter_timezone_to_country
country-codes flutter flutter-package flutter-plugin timezone
Last synced: 16 days ago
JSON representation
Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')
- Host: GitHub
- URL: https://github.com/kyle-seongwoo-jun/flutter_timezone_to_country
- Owner: kyle-seongwoo-jun
- License: mit
- Created: 2021-01-09T05:58:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T13:46:17.000Z (6 months ago)
- Last Synced: 2024-10-17T03:10:02.682Z (27 days ago)
- Topics: country-codes, flutter, flutter-package, flutter-plugin, timezone
- Language: Dart
- Homepage: https://pub.dev/packages/timezone_to_country
- Size: 484 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# timezone_to_country
[![pub package](https://img.shields.io/pub/v/timezone_to_country.svg)](https://pub.dev/packages/timezone_to_country)
[![pub points](https://img.shields.io/pub/points/timezone_to_country?color=2E8B57&label=pub%20points)](https://pub.dev/packages/timezone_to_country/score)
[![device_info_plus](https://github.com/kyle-seongwoo-jun/flutter_timezone_to_country/actions/workflows/flutter.yml/badge.svg)](https://github.com/kyle-seongwoo-jun/flutter_timezone_to_country/actions/workflows/flutter.yml)Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')
![example](https://raw.githubusercontent.com/kyle-seongwoo-jun/flutter_timezone_to_country/master/images/example.png)
## Usage
```dart
TimeZoneToCountry.getCountryCode('Asia/Seoul') // 'KR'
TimeZoneToCountry.getCountryCode('America/Los_Angeles') // 'US'
TimeZoneToCountry.getCountryCode('Europe/London') // 'GB'
``````dart
String code = await TimeZoneToCountry.getLocalCountryCode();
print(code); // 'KR'
```## Source of Time Zone
IANA - Time Zone Database - 2024a ()