python time difference
import datetime
time_1 = datetime.strptime('05:00:00',"%H:%M:%S")
time_2 = datetime.strptime('10:00:00',"%H:%M:%S")
time_interval = time_2 - time_1
print(time_difference)
>>> 5:00:00
OR
import time
time_1 = time.time()
time.sleep(20)
time_2 = time.time()
time_interval = time_2 - time_1
print(time_interval)
>>> 20.005916118621826
OR
import datetime
time_1 = datetime.timedelta(hours= 10 , minutes=20, seconds=30)
time_2 = datetime.timedelta(hours= 20, minutes=30, seconds=45)
print(time_2 - time_1)