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
5c5f00ca
Commit
5c5f00ca
authored
Dec 12, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mktime_tz() which turns a date_tz 10-tuple into a standard Unix timestamp.
parent
42f51968
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Lib/rfc822.py
Lib/rfc822.py
+11
-0
No files found.
Lib/rfc822.py
View file @
5c5f00ca
...
...
@@ -468,6 +468,17 @@ def parsedate(data):
return
t
[:
9
]
else
:
return
t
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.
"""
t
=
time
.
mktime
(
data
[:
8
]
+
(
0
,))
return
t
+
data
[
9
]
-
time
.
timezone
# When used as script, run a small test program.
# The first command line argument must be a filename containing one
...
...
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