I have a Dataframe where I'm making the difference between two different dates to get the difference in Hours and Minutes, for example:
data_inicial = '2018-07-03 16:03:00'
data_final = '2018-07-05 00:00:00'
duracao = data_final - data_inicial
The result I'm looking for is: '31: 57: 00 ', meaning 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 to convert to an XMinutes format with the statement:
print(datetime.datetime.strptime(duracao, "%H:%M:%S"))
But I got the error:
ValueError: time data '1 day, 7:57:00' does not match format '% H:% M:% S'
Any ideas?