The api I am working with gives time is the following format when I place an order.
'orderDateTime': '12-May-2020 14:54:11'
What I am looking to do is to find the number of minutes/seconds that have passed since I placed the order. So if it has already been for example 10 minutes, if I would like to cancel or modify the order I can do it.
I have tried everything I know to convert the given time format to do what I want but have been unsuccessful. Please help. Thanks in advance.
time_now = datetime.now()
print("Time now is",time_now)
t1 = time_now.strftime("%d-%b-%Y %H:%M:%S")
print(t1)
trade_time = datetime(12-May-2020 15:01:32)
t2 = datetime.strftime(trade_time,"%d-%b-%Y %H:%M:%S")
print(t2)