Created
April 30, 2018 09:34
-
-
Save monk1337/f2df71e798981097d13149410e095c66 to your computer and use it in GitHub Desktop.
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
def get_last_sunday(): | |
from datetime import date | |
from dateutil.relativedelta import relativedelta, SU | |
today = date.today() | |
last_monday = today + relativedelta(weekday=SU(-1)) | |
return last_monday.strftime("%Y-%m-%d") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment