Created
May 6, 2019 04:11
-
-
Save hughdbrown/7bdc932f7d4271d9289f2630e193c390 to your computer and use it in GitHub Desktop.
Generate end of month strings
This file contains hidden or 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
from datetime import datetime, timedelta | |
for year in range(2006, 2020): | |
for month in range(1, 13): | |
# Get the last day of the previous month | |
d = datetime(year, month, 1) - timedelta(1) | |
print(d.strftime("%Y-%m-%d")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment