Skip to content

World timezone definitions by country subdivision (e.g., provinces or states)

License

Notifications You must be signed in to change notification settings

maxim-s-barabash/pytzsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytzsub

Build Status PyPI version License: MIT

World timezone definitions by country subdivision (e.g., provinces or states)

Accuracy of the database

The database is not authoritative, and it surely has errors. Corrections are welcome and encouraged.

Installation

As per usual:

pip install pytzsub

Examples

>>> from pytzsub import sub_timezone
>>> sub_timezone('US-CA')
'America/Los_Angeles'
>>> from pytzsub import all_code
>>> 'US-CA' in all_code()
True
>>> from pytzsub import sub_timezone
>>> from pytz import timezone
>>> tz = timezone(sub_timezone('CA-QC'))
>>> type(tz)
<class 'pytz.tzfile.America/Toronto'>

Links

About

World timezone definitions by country subdivision (e.g., provinces or states)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages