Search packages, repositories and app categories

Package detailsv3.2.0

timezone_to_country

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

AndroidiOSLinuxmacOSWebWindows
30-day downloads
82.4K
Likes
11
Pub points
160

Install package

flutter pub add timezone_to_country

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The timezone_to_country package provides an extension method to convert time zone identifiers (like 'Asia/Seoul') into their corresponding ISO 3166-1 alpha-2 country codes (like 'KR'). It simplifies geolocation logic by enabling developers to map time zones to countries efficiently. Built for Flutter, it supports all major platforms including Android, iOS, Linux, macOS, Web, and Windows. The package is lightweight and designed for use in apps requiring time zone-based country resolution.

Use cases

  • Converting time zones to country codes
  • Displaying user location based on time zone
  • Enhancing geolocation features
  • Supporting internationalized app settings
  • Automating region detection from time zone data

Key features

  • Simple extension method
  • Supports all Flutter platforms
  • Uses ISO 3166-1 alpha-2 codes
  • Lightweight and easy to integrate
  • Accurate time zone to country mapping

Suitable for

  • Apps needing time zone to country conversion
  • Internationalized applications
  • Location-aware services
  • Backend or frontend geolocation utilities
  • Developers seeking minimal dependencies

Considerations

  • Relies on accurate time zone database
  • Does not handle ambiguous or custom time zones
  • Requires valid input time zone IDs
  • No runtime error handling for invalid inputs
  • Limited to country code output only

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

timezone_to_country

pub package pub points pub downloads flutter ci

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 - 2025c

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.

Rankings