python numpy datetime64 today Posted on 2018-09-27 | Edited on 2018-07-14 | In python python numpy datetime64 today12345678910111213141516>>> import numpy as np>>> import datetime>>> today = np.datetime64(datetime.datetime.now())>>> todaynumpy.datetime64('2018-07-12T19:12:39.167044')>>> past = np.datetime64('2018-01-01')>>> pastnumpy.datetime64('2018-01-01')>>> dif = today - past>>> difnumpy.timedelta64(16657959167044,'us')>>> dif = np.timedelta64(dif, 'D')>>> difnumpy.timedelta64(192,'D')>>> dif.astype(int)192 more on searchfor.space Post author: killfun Post link: http://search4fan.github.io/post/python_timedelta_days.html Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.