Skip to content


Timezone sorting #8

merged 1 commit into from

3 participants



I added a simple patch to change the way timezones are sorted by default, in a way that I think is more user friendly. With this change, we sort by (GMT offset, name) rather than just by (name). Since the names tend to be hard to guess - my personal timezone is "America/Vancouver" even though I'm in Canada? - this makes it easier to find things in the list.

Have fun,


@brosner brosner merged commit 8da6548 into brosner:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 28, 2010
  1. @apenwarr
Showing with 5 additions and 1 deletion.
  1. +5 −1 timezones/
6 timezones/
@@ -10,4 +10,8 @@
for tz in pytz.common_timezones:
now =
- PRETTY_TIMEZONE_CHOICES.append((tz, "(GMT%s) %s" % (now.strftime("%z"), tz)))
+ ofs = now.strftime("%z")
+ PRETTY_TIMEZONE_CHOICES.append((int(ofs), tz, "(GMT%s) %s" % (ofs, tz)))
+for i in xrange(len(PRETTY_TIMEZONE_CHOICES)):
Something went wrong with that request. Please try again.