# HG changeset patch # User cmlenz # Date 1132747818 0 # Node ID 1016c3d12cbc4e2b58244550ab202f640f9a6f04 # Parent 7f6fc38e14ff9b09faae9836495fd4b817a3b0c7 Fix UTC timestamp handling in build master. diff --git a/bitten/master.py b/bitten/master.py --- a/bitten/master.py +++ b/bitten/master.py @@ -7,6 +7,7 @@ # you should have received as part of this distribution. The terms # are also available at http://bitten.cmlenz.net/wiki/License. +import calendar from datetime import datetime, timedelta import logging import os @@ -346,11 +347,7 @@ without time zone information.""" try: string = string.split('.', 1)[0] # strip out microseconds - secs = time.mktime(time.strptime(string, '%Y-%m-%dT%H:%M:%S')) - tzoffset = time.timezone - if time.daylight: - tzoffset = time.altzone - return secs - tzoffset + return calendar.timegm(time.strptime(string, '%Y-%m-%dT%H:%M:%S')) except ValueError, e: raise ValueError, 'Invalid ISO date/time %s (%s)' % (string, e)