Created
July 10, 2015 16:17
-
-
Save gfranxman/9af990acb122b9a64cd5 to your computer and use it in GitHub Desktop.
Django US TIMEZONE Choices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pytz | |
| TIMEZONES = [ (t,t) for t in pytz.common_timezones if t.startswith("US/") ] | |
| TIMEZONES.sort( key=lambda t: pytz.timezone(t[0])._utcoffset.seconds/3600, reverse=True ) | |
| >>> TIMEZONES | |
| [('US/Eastern', 'US/Eastern'), ('US/Central', 'US/Central'), ('US/Mountain', 'US/Mountain'), ('US/Arizona', 'US/Arizona'), ('US/Pacific', 'US/Pacific'), ('US/Alaska', 'US/Alaska'), ('US/Hawaii', 'US/Hawaii')] | |
| >>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment