I have two meanings. The expected amount of time that I think the action will take, and the value of how long it really took to complete this task. When searching for a solution, I found this code that works until the task takes longer than expected.
Expected = '00:00:20'
Actual = '00:00:25'
FMT = '%H:%M:%S'
Difference = datetime.strptime(Expected, FMT) - datetime.strptime(Actual, FMT)
print(Difference)
Will print
-1 day, 23:59:55
So, I was wondering, how can I get a result that will display as -00: 00: 05 instead?
source
share