ZoneTab class

Offline lookup for country and IANA timezone mappings backed by the tzdata files shipped with every Linux distribution.

systemd does not expose this information over D-Bus, so this class reads zone1970.tab (or zone.tab as a fallback) and iso3166.tab from the zoneinfo directory. Results are cached per instance after the first read.

Constructors

ZoneTab({String zoneinfoDir = '/usr/share/zoneinfo'})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

countriesForTimezone(String timezone) Future<List<String>>
ISO codes whose timezone list contains timezone, preserving the order declared in zone1970.tab: the primary country (most-populous) comes first, with any secondary countries listed after in their original order. Returns an empty list when the timezone is unknown.
getCountries() Future<Map<String, String>>
ISO 3166-1 alpha-2 code to human-readable country name.
getCountryTimezones() Future<Map<String, List<String>>>
ISO 3166-1 alpha-2 code to sorted list of IANA timezone names for that country. Prefers zone1970.tab (which supports multi-country zones) and falls back to zone.tab.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
timezonesForCountry(String countryCode) Future<List<String>>
Timezones for a single country code (case-insensitive). Returns an empty list when the code is unknown.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited