I have a Dataframe in which I am making the difference between two different dates to get the difference in Hours and Minutes, for example:
start_date = '2018-07-03 16:03:00'
data_final = '2018-07-05 00:00:00'
duration = data_final - start_date
The result I'm looking for is '31: 57: 00 ', or the total time difference between the two dates. But the result I have is: '1 day, 7:57:00' (Every 24 hours it writes as 1 day).
I tried converting it to an XMinutesHours format with the statement:
print (datetime.datetime.strptime (duration, "%H:%M:%S"))
But I got the error:
ValueError: time data '1 day, 7:57:00' does not match format '% H:% M:% S'
Any idea?