summaryrefslogtreecommitdiff
path: root/date.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2010-02-08 21:26:43 +0100
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2010-02-08 21:26:43 +0100
commitf4af73a594f5dbf6c6680954154f7b06f5544ba8 (patch)
treed3776559de2508f0fc6794edcb0b85cd8c11e27d /date.py
parent68e6d24c3b90123e4ecbc61c3c633c45af6f52a8 (diff)
downloadlogilab-common-f4af73a594f5dbf6c6680954154f7b06f5544ba8.tar.gz
bacport change set 4505:71ba2d0f34f2 from cw stable:
use calendar.gmtime instead of time.mktime to avoid UTC/localtime issues with Flot
Diffstat (limited to 'date.py')
-rw-r--r--date.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/date.py b/date.py
index b2dc370..4eb4b42 100644
--- a/date.py
+++ b/date.py
@@ -9,8 +9,8 @@ __docformat__ = "restructuredtext en"
import math
from locale import getpreferredencoding
from datetime import date, time, datetime, timedelta
-from time import strptime as time_strptime, mktime
-from calendar import monthrange
+from time import strptime as time_strptime
+from calendar import monthrange, timegm
try:
from mx.DateTime import RelativeDateTime, Date
@@ -206,7 +206,7 @@ def todatetime(somedate):
return datetime(somedate.year, somedate.month, somedate.day)
def datetime2ticks(somedate):
- return mktime(somedate.timetuple()) * 1000
+ return timegm(somedate.timetuple()) * 1000
ONEDAY = timedelta(days=1)
ONEWEEK = timedelta(days=7)