Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
3abb0fe8
Commit
3abb0fe8
authored
Dec 04, 2008
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include *all* pytz zone names, not just "common" ones.
Fix one fragile doctest, band-aid another.
parent
ebb12c44
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+1
-1
lib/python/DateTime/DateTime.txt
lib/python/DateTime/DateTime.txt
+8
-2
lib/python/DateTime/pytz.txt
lib/python/DateTime/pytz.txt
+1
-1
No files found.
lib/python/DateTime/DateTime.py
View file @
3abb0fe8
...
...
@@ -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
())
)
lib/python/DateTime/DateTime.txt
View file @
3abb0fe8
...
...
@@ -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
==============
...
...
lib/python/DateTime/pytz.txt
View file @
3abb0fe8
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment