0

I wanted to calculate the time duration between current time and specific time, but it keeps showing unsupported operand type(s) for -: 'datetime.time' and 'datetime.time', what does it mean and why I can't minus the time ?

current_time = dt.datetime.now().time()

FMT = '%H:%M:%S'
t1 = '10:33:26'
t1_obj = dt.datetime.strptime(t1, FMT).time()

tduration = current_time - t1_obj
print(tduration)
FObersteiner
  • 22,500
  • 8
  • 42
  • 72

0 Answers0