wrongmove/crawler/rec/utils.py

22 lines
527 B
Python
Raw Normal View History

from datetime import datetime, timedelta, timezone
2024-03-25 20:48:48 +00:00
def nextMonday():
"""
I think this function doesnt work when the day is monday itself.
Returns:
_type_: _description_
"""
now = datetime.now(timezone.utc)
days_until_monday = (0 - now.weekday() + 7) % 7
monday = now + timedelta(days=days_until_monday)
2024-03-25 20:48:48 +00:00
monday_9am = monday.replace(
hour=9, minute=0, second=0, microsecond=0, tzinfo=timezone.utc
)
return monday_9am
2024-03-25 20:48:48 +00:00
if __name__ == "__main__":
print(nextMonday())