CountryTimezone
Delphi module provides a mapping from ISO 3166 country codes to a list of timezone names
- Active · last change 10-14-2025
- ★ 2 on GitHub
README
CountryTimezone
CountryTimezone is a Delphi module provides a mapping from ISO 3166 country codes to a list of timezone names commonly used within that country. This allows you to easily find the relevant timezones for a given country. It uses IANA tzdb timezone descriptions from zone1970.tab.
Usage
List All Country Timezones
procedure GetAllCountryTimezones(const AList: TStrings);
var
CountryNameDictionary: TCountryTimezoneDictionary;
code: String;
begin
CountryNameDictionary := TCountryTimezoneDictionary.Create();
try
for code in CountryNameDictionary.Keys do begin
AList.Add(code+': '+CountryNameDictionary[code]);
end;
finally
CountryNameDictionary.Free;
end;
end;Get Country Timezones
procedure GetCountryTimezones(const AList: TStrings);
var
CountryNameDictionary: TCountryTimezoneDictionary;
begin
CountryNameDictionary := TCountryTimezoneDictionary.Create();
try
CountryNameDictionary.GetCountryTimezones('US', AList);
finally
CountryNameDictionary.Free;
end;
end;
