I need to create a report where I need to subtract two dates and return it in the form of %H:%M%S
This is the subtraction which I inserted into a list :
time_difference_temp=datetime.strptime(next_time,"%Y-%m-%d %H:%M:%S") - datetime.strptime(current_time,"%Y-%m-%d %H:%M:%S")
time_difference.append(time_difference_temp)
return time_difference
this list returns to >
def push_to_csv(time_difference):
df = pd.read_csv('time_differences.csv')
df["Delta"] = time_difference
df.dropna(subset=["Data"], inplace=True)
df.to_csv("Final_ReportX.csv")
in the csv Final_ReportX it saved in the form : 0 days 00:05:39
I need it to return just 00:05:39, no days.
*regex is not an option
Thanks!