How to increment the day in datetime? In python.
for i in xrange(1,5)
date=datetime.datetime(2003,8,i,12,4,5)
print date
But i need pass through years? Any ideas? Should be easyier way....
How to increment the day in datetime? In python.
for i in xrange(1,5)
date=datetime.datetime(2003,8,i,12,4,5)
print date
But i need pass through years? Any ideas? Should be easyier way....
date=datetime.datetime(2003,8,1,12,4,5)
for i in range(5):
date += datetime.timedelta(days=1)
print(date)
Incrementing date can be done using timedelta objects
import datetime
datetime.datetime.now() + datatime.timedelta(days=1)
Look up timedelta objects in the python docs: http://docs.python.org/library/datetime.html