Revision: 4055
Author: pekka.klarck
Date: Tue Sep 7 12:04:48 2010
Log: Using the current daylight saving time status when converting
timestamps to millis is wrong. Not sure how this oculd be tested.
http://code.google.com/p/robotframework/source/detail?r=4055
Modified:
/trunk/src/robot/utils/robottime.py
=======================================
--- /trunk/src/robot/utils/robottime.py Tue Sep 7 11:58:44 2010
+++ /trunk/src/robot/utils/robottime.py Tue Sep 7 12:04:48 2010
@@ -321,10 +321,11 @@
def _timestamp_to_millis(timestamp, seps):
- years, mons, days, hours, mins, secs, millis =
_split_timestamp(timestamp, seps)
- timetuple = (years, mons, days, hours, mins, secs, 0, 0, time.daylight)
- secs = time.mktime(timetuple)
- return long(1000 * secs) + millis
+ years, mons, days, hours, mins, secs, millis \
+ = _split_timestamp(timestamp, seps)
+ # -1 means that mktime will guess should it use DST based on date and
time
+ secs = time.mktime((years, mons, days, hours, mins, secs, 0, 0, -1))
+ return 1000*secs + millis
def _split_timestamp(timestamp, seps):
for sep in seps: