Commit 3abb0fe8 authored by Tres Seaver's avatar Tres Seaver

Include *all* pytz zone names, not just "common" ones.

Fix one fragile doctest, band-aid another.
parent ebb12c44
......@@ -1848,5 +1848,5 @@ class strftimeFormatter:
# Module methods
def Timezones():
"""Return the list of recognized timezone names"""
return list(PytzCache._zlst)
return sorted(list(PytzCache._zmap.values()))
......@@ -11,9 +11,15 @@ Function Timezones()
Returns the list of recognized timezone names:
>>> from DateTime import Timezones
>>> Timezones() # doctest: +ELLIPSIS
[...'Brazil/Acre'... 'Brazil/DeNoronha'... 'IDLE'... 'NZST'...]
>>> zones = set(Timezones())
Almost all of the standard pytz timezones are included, with the exception
of some commonly-used but ambiguous abbreviations, where historical Zope
usage conflicts with the name used by pytz:
>>> import pytz
>>> [x for x in pytz.all_timezones if x not in zones]
['CET', 'EET', 'EST', 'MET', 'MST', 'WET']
Class DateTime
==============
......
......@@ -132,7 +132,7 @@ The _zidx attribute is a list of lower-case and possibly abbreviated
time zone names that can be mapped to offical zone names.
>>> cache._zidx #doctest: +ELLIPSIS
['australia/yancowinna'... 'gmt+0500'... 'europe/isle_of_man'...]
[... 'australia/yancowinna'... 'gmt+0500'... 'europe/isle_of_man'...]
Note that there are more items in _zidx than in _zlst since there are
multiple names for some time zones.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment