["python","datetime"]
Print all day-dates between two dates

For example: from datetime import date d1 = date(2008,8,15) d2 = date(2008,9,15) I'm looking for simple code to print all dates in-between: 2008,8,15 2008,8,16 2008,8,17 ... 2008,9,14 2008,9,15 Thanks
I came up with this: from datetime import date, timedelta start_date = date(2008, 8, 15) end_date = date(2008, 9, 15) # perhaps date.today() delta = end_date - start_date # returns timedelta for i in range(delta.days + 1): day = start_date + timedelta(days=i) print(day) The output: 2008-08-15 2008-08-16 ... 2008-09-13 2008-09-14 2008-09-15 Your question asks for dates in-between but I believe you meant including the start and end points, so they are included. Otherwise: # To remove the end date, delete the "+ 1" # at the end of the range function: for i in range(delta.days): # To remove the start date, insert a 1 # to the beginning of the range function: for i in range(1, delta.days + 1):