[web/request] don't play tricks with utc offset
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 26 Mar 2015 08:34:47 +0100
changeset 10304 b6c55274135a
parent 10303 593e63a68429
child 10305 937deb71a681
[web/request] don't play tricks with utc offset We need an UTC datetime from a time.time()-type value. It turns out datetime provides a method to do just that. Related to #2154655.
web/request.py
--- a/web/request.py	Wed Mar 25 08:43:00 2015 +0100
+++ b/web/request.py	Thu Mar 26 08:34:47 2015 +0100
@@ -811,8 +811,7 @@
         """
         mtime = self.get_header('If-modified-since', raw=False)
         if mtime:
-            # :/ twisted is returned a localized time stamp
-            return datetime.fromtimestamp(mtime) + GMTOFFSET
+            return datetime.utcfromtimestamp(mtime)
         return None
 
     ### outcoming headers