Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

optinsoft/CountryTimezone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

Delphi module provides a mapping from ISO 3166 country codes to a list of timezone names

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published