How to find the time difference in minutes.
Below is the time format t1 and t2
t1 = 01/24 14:50:0
t2 = 1/24 14:52:01
Difference is two minutes
How to achieve this
I tried below code but not working:
fmt = '%m/%d %H:%M:%S'
d1 = datetime.strptime('01/24 14:50:0', fmt)
d2 = datetime.strptime('1/24 14:52:01', fmt)
d1_ts = time.mktime(d1.timetuple())
d2_ts = time.mktime(d2.timetuple())
print (int(d1_ts-d2_ts) / 60)