Mercurial > bitten > bitten-test
changeset 312:1016c3d12cbc
Fix UTC timestamp handling in build master.
author | cmlenz |
---|---|
date | Wed, 23 Nov 2005 12:10:18 +0000 |
parents | 7f6fc38e14ff |
children | 90422699a594 |
files | bitten/master.py |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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)