python timedelta to seconds Posted on 2018-09-27 | Edited on 2018-07-14 | In python python timedelta to seconds1234567891011121314151617import numpy as np import datetimetoday = np.datetime64(datetime.datetime.today())today# numpy.datetime64('2018-07-12T19:28:08.889374')past = np.datetime64('2018-07-11')past# numpy.datetime64('2018-07-11')dif = today - pastdif# numpy.timedelta64(156488889374,'us')dif.astype(int)# 1870066718 more on searchfor.space Post author: killfun Post link: http://search4fan.github.io/post/python_timedelta _to_seconds.html Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.