Created
January 23, 2020 22:48
-
-
Save avolkov/9b6a8c6133e1bbdaf77813d70ee542f3 to your computer and use it in GitHub Desktop.
datetime.date can do math with timedelta periods
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
from datetime import date, timedelta | |
today = date.today() | |
monday = today - timedelta(today.weekday()) | |
for k in range(0,7): | |
print(monday + timedelta(days=k)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment