Created
August 15, 2014 14:38
-
-
Save gdmachado/9ae55b4c431f6e31a305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def genDateRange(startDate, endDate): | |
dt0 = datetime.datetime.strptime(startDate, "%Y-%m-%d") | |
dt1 = datetime.datetime.strptime(endDate, "%Y-%m-%d") | |
for n in range(int ((dt1 - dt0).days) + 1): | |
yield (dt0 + datetime.timedelta(n)).strftime("%Y-%m-%d") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment