Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from datetime import date, timedelta
- def next_sunday(today: date | None = None) -> date:
- if today is None:
- today = date.today()
- one_day = timedelta(days=1)
- if today.weekday() == 6:
- today += one_day
- while today.weekday() != 6:
- today += one_day
- return today
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement