diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-02-08 21:26:43 +0100 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-02-08 21:26:43 +0100 |
commit | f4af73a594f5dbf6c6680954154f7b06f5544ba8 (patch) | |
tree | d3776559de2508f0fc6794edcb0b85cd8c11e27d /date.py | |
parent | 68e6d24c3b90123e4ecbc61c3c633c45af6f52a8 (diff) | |
download | logilab-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.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |