[Zope3-checkins] CVS: Zope3/src/zope/server/http - http_date.py:1.5
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Mar 19 19:01:07 EST 2004
Update of /cvs-repository/Zope3/src/zope/server/http
In directory cvs.zope.org:/tmp/cvs-serv16932/src/zope/server/http
Modified Files:
http_date.py
Log Message:
Fixed issue 159 using supplied patch.
=== Zope3/src/zope/server/http/http_date.py 1.4 => 1.5 ===
--- Zope3/src/zope/server/http/http_date.py:1.4 Wed Mar 26 06:52:54 2003
+++ Zope3/src/zope/server/http/http_date.py Fri Mar 19 19:01:07 2004
@@ -11,14 +11,14 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
+"""HTTP Server Date/Time utilities
$Id$
"""
-
import re
import string
import time
+import calendar
def concat(*args):
return ''.join(args)
@@ -134,15 +134,14 @@
hh, mm, ss)
def parse_http_date(d):
- d = string.lower(d)
- tz = time.timezone
+ d = d.lower()
m = rfc850_reg.match(d)
if m and m.end() == len(d):
- retval = int(time.mktime(unpack_rfc850(m)) - tz)
+ retval = int(calendar.timegm(unpack_rfc850(m)))
else:
m = rfc822_reg.match(d)
if m and m.end() == len(d):
- retval = int(time.mktime(unpack_rfc822(m)) - tz)
+ retval = int(calendar.timegm(unpack_rfc822(m)))
else:
return 0
return retval
More information about the Zope3-Checkins
mailing list