lets not concatenate strings and integers, hey?

This commit is contained in:
Aaron Static
2010-07-01 19:38:14 +10:00
parent c8bfe4e574
commit faf3cba87d

View File

@@ -142,7 +142,7 @@ class OpTimerHandler(BaseHandler):
dt = datetime.strptime(date,'%Y-%m-%d %H:%M:%S') dt = datetime.strptime(date,'%Y-%m-%d %H:%M:%S')
now = datetime.utcnow() now = datetime.utcnow()
startsIn = int(dt.strftime('%s')) - int(now.strftime('%s')) startsIn = int(dt.strftime('%s')) - int(now.strftime('%s'))
duration = node.getAttribute('duration') duration = int(node.getAttribute('duration'))
endsIn = startsIn + (duration * 60) endsIn = startsIn + (duration * 60)
if startsIn < 0: if startsIn < 0:
startsIn = 0 startsIn = 0