Get day of year from python arrow -
_date = '2017-03-17t00:00:00' import arrow arrow.get(_date)
how can day of year above code?
you asking arrow solution, here alternative datetime library.
as explained by: converting python time stamp day of year answer seeking:
import datetime _date = '2017-03-17t00:00:00' dt = datetime.datetime.strptime(_date, '%y-%m-%dt%h:%m:%s') print(dt.timetuple().tm_yday) # prints 76
Comments
Post a Comment