Skip to content

Python library for mapping ISO 3166-1 alpha-2 country codes to Olson timezone names

Notifications You must be signed in to change notification settings

naktinis/country-timezone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

country-timezone

Python library for mapping ISO 3166-1 alpha-2 country codes to Olson timezone names.

When country-level is too coarse, you may choose from a list of timezones by coordinates: latitude and longitude of the zone's principal location in ISO 6709 sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS, first latitude (+ is north), then longitude (+ is east).

Usage example:

all_us_timezones = timezones['US']                       # Returns a dict by coordinates
honalulu_timezone = timezone['US']['+211825-1575130']    # Returns 'Pacific/Honolulu'

Country names are compatible with GeoIP database (for example, there's EU "country").

About

Python library for mapping ISO 3166-1 alpha-2 country codes to Olson timezone names

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages