Personal tools
You are here: Home Members nigel Scripts Date sweep
Document Actions

Date sweep

by Nigel Sim last modified 2006-06-22 11:40

Iterate over a date range in python.

Click here to get the file

Size 1 kB - File type text/python-source

File contents

from datetime import date, timedelta

step = timedelta(1) # one day at a time
start = date(2005,1,1)
end = date.today()

d = start
while d <= end:
    print d
    d = d + step

Powered by Plone, the Open Source Content Management System