Last active
November 22, 2020 19:41
-
-
Save askedrelic/871b07074f890d48e7f95b5b97f66344 to your computer and use it in GitHub Desktop.
Python formatted dates #python
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
import arrow | |
dates = [arrow.now().replace(days=x).format('YYYY-MM-DD') for x in range(90)] | |
for x in dates: print x |
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
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]" |
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
# 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]" |
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
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