Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jefersondaniel/7e1e137c170288c60f8daf43f834563a to your computer and use it in GitHub Desktop.
Save jefersondaniel/7e1e137c170288c60f8daf43f834563a to your computer and use it in GitHub Desktop.
daterange.py
from datetime import datetime, timedelta
actual_date = datetime(2018, 5, 8)
end_date = datetime(2018, 7, 18)
out = open('/tmp/daterange.txt', 'w')
while actual_date < end_date:
out.write(actual_date.strftime('%Y-%m-%d') + '\n')
actual_date = actual_date + timedelta(days=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment