I have a variable which is <type 'datetime.timedelta'>
and I would like to compare it against certain values.
Lets say d produces this datetime.timedelta
value 0:00:01.782000
I would like to compare it like this:
#if d is greater than 1 minute
if d>1:00:
print "elapsed time is greater than 1 minute"
I have tried converting datetime.timedelta.strptime()
but that does seem to work. Is there an easier way to compare this value?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…