Skip to content

Instantly share code, notes, and snippets.

@askedrelic
Last active November 22, 2020 19:41
Show Gist options
  • Save askedrelic/871b07074f890d48e7f95b5b97f66344 to your computer and use it in GitHub Desktop.
Save askedrelic/871b07074f890d48e7f95b5b97f66344 to your computer and use it in GitHub Desktop.
Python formatted dates #python
import arrow
dates = [arrow.now().replace(days=x).format('YYYY-MM-DD') for x in range(90)]
for x in dates: print x
python -c "from __future__ import print_function; import arrow; dates = [arrow.now().replace(days=x).format('YYYY-MM-DD') for x in range(90)]; [print(x) for x in dates]"
# 90 days, scratch format, +/- 5days
# py3 + arrow 0.17 compat
python -c "import arrow; dates = [arrow.now().shift(days=x-5).format('dddd M/D/YY') for x in range(100)]; [print(x) for x in dates]"
import arrow;
dates = [arrow.now().replace(days=x).format('dddd M/D/YY') for x in range(90)]
for x in dates: print x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment