Skip to content

Instantly share code, notes, and snippets.

@mila
Created December 15, 2016 18:49
Show Gist options
  • Save mila/b65d420825956199733d9b9d85bcf7b1 to your computer and use it in GitHub Desktop.
Save mila/b65d420825956199733d9b9d85bcf7b1 to your computer and use it in GitHub Desktop.
import datetime
start = datetime.date(2016, 11, 1)
stop = datetime.date(2016, 12, 1)
delta = datetime.timedelta(days=1)
tpl = "year=%(year)04d/month=%(month)02d/week=%(week)02d/day=%(day)02d"
date = start
while date < stop:
print tpl % {
'year': date.year,
'month': date.month,
'day': date.day,
'week': date.isocalendar()[1],
}
date += delta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment