datetime - Iterating through a range of dates in Python - Stack Overflow

PHOTO EMBED

Fri May 15 2020 06:32:03 GMT+0000 (Coordinated Universal Time)

Saved by @salitha.pathi #python

from datetime import date
from dateutil.rrule import rrule, DAILY

a = date(2009, 5, 30)
b = date(2009, 6, 9)

for dt in rrule(DAILY, dtstart=a, until=b):
    print dt.strftime("%Y-%m-%d")
content_copyCOPY

https://stackoverflow.com/questions/1060279/iterating-through-a-range-of-dates-in-python