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") |