Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
67133e25
Commit
67133e25
authored
May 18, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Neatify the _timezones table and remove a misleading comment about
inaccuracies in mktime_tz().
parent
3130b7a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
Lib/rfc822.py
Lib/rfc822.py
+5
-12
No files found.
Lib/rfc822.py
View file @
67133e25
...
...
@@ -632,11 +632,11 @@ _daynames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
# instead of timezone names.
_timezones
=
{
'UT'
:
0
,
'UTC'
:
0
,
'GMT'
:
0
,
'Z'
:
0
,
'AST'
:
-
400
,
'ADT'
:
-
300
,
# Atlantic
standard
'AST'
:
-
400
,
'ADT'
:
-
300
,
# Atlantic
(used in Canada)
'EST'
:
-
500
,
'EDT'
:
-
400
,
# Eastern
'CST'
:
-
600
,
'CDT'
:
-
500
,
# Centre
al
'MST'
:
-
700
,
'MDT'
:
-
600
,
# Mountain
'PST'
:
-
800
,
'PDT'
:
-
700
# Pacific
'CST'
:
-
600
,
'CDT'
:
-
500
,
# Centr
al
'MST'
:
-
700
,
'MDT'
:
-
600
,
# Mountain
'PST'
:
-
800
,
'PDT'
:
-
700
# Pacific
}
...
...
@@ -713,14 +713,7 @@ def parsedate(data):
def
mktime_tz
(
data
):
"""Turn a 10-tuple as returned by parsedate_tz() into a UTC timestamp.
Minor glitch: this first interprets the first 8 elements as a
local time and then compensates for the timezone difference;
this may yield a slight error around daylight savings time
switch dates. Not enough to worry about for common use.
"""
"""Turn a 10-tuple as returned by parsedate_tz() into a UTC timestamp."""
if
data
[
9
]
is
None
:
# No zone info, so localtime is better assumption than GMT
return
time
.
mktime
(
data
[:
8
]
+
(
-
1
,))
...
...
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