How to get time difference in seconds from numpy.timedelta64 variable?
time1 = '2012-10-05 04:45:18'
time2 = '2012-10-05 04:44:13'
dt = np.datetime64(time1) - np.datetime64(time2)
print dt
0:01:05
I'd like to convert dt
to number (int or float) representing time difference in seconds.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…