timedelta comparision with gmtime()

Florian Lindner Florian.Lindner at xgm.de
Wed Jun 22 19:47:49 CEST 2005


Hello,
I want to know if a certain duration is over.
I try it like this with timedelta objects:

d = datetime.timedelta(minutes = 2)
t = time.gmtime()
print (t + d < time.gmtime())

gives:

TypeError: unsupported operand type(s) for +: 'datetime.timedelta' and
'time.struct_time'

How to do that right?

Thanks,

Florian





More information about the Python-list mailing list