use calendar.gmtime instead of time.mktime to avoid UTC/localtime issues with Flot
This is suggested by the Flot documentation on http://people.iola.dk/olau/flot/API.txt
--- a/utils.py Thu Feb 04 18:29:43 2010 +0100
+++ b/utils.py Fri Feb 05 17:57:51 2010 +0100
@@ -15,9 +15,9 @@
import datetime as pydatetime
from md5 import md5
from datetime import datetime, timedelta, date
-from time import time, mktime
+from time import time
from random import randint, seed
-from calendar import monthrange
+from calendar import monthrange, timegm
# initialize random seed from current time
seed()
@@ -44,7 +44,7 @@
return datetime(somedate.year, somedate.month, somedate.day)
def datetime2ticks(date):
- return mktime(date.timetuple()) * 1000
+ return timegm(date.timetuple()) * 1000
ONEDAY = timedelta(days=1)
ONEWEEK = timedelta(days=7)