Skip to content

Instantly share code, notes, and snippets.

@reinhrst
Last active November 8, 2015 11:57
Show Gist options
  • Select an option

  • Save reinhrst/d3685a8f6ef41224b74b to your computer and use it in GitHub Desktop.

Select an option

Save reinhrst/d3685a8f6ef41224b74b to your computer and use it in GitHub Desktop.
#!/bin/bash
# oneliner to print a range of dates, ending today
for i in $(seq -f %.0f $(date -j -f %Y-%m-%d 2015-10-15 +%s) $((24 * 60 * 60)) $(date +%s)); do date -jf %s $i +%Y-%m-%d; done
# and one in python
python -c "import datetime; date = datetime.date(2015, 10, 5); days = range((datetime.date.today() - date).days); print(' '.join(str(date + datetime.timedelta(day)) for day in days))"
@reinhrst
Copy link
Author

reinhrst commented Nov 6, 2015

Works on OSX.... Not by default on ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment