32 lines
639 B
Python
Executable file
32 lines
639 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import datetime
|
|
import time
|
|
import zoneinfo
|
|
|
|
def main():
|
|
today = datetime.date.today()
|
|
|
|
current_weekday = today.weekday()
|
|
if current_weekday == 6:
|
|
days_to_next_sunday = 6
|
|
else:
|
|
days_to_next_sunday = 6 - current_weekday
|
|
|
|
delta = datetime.timedelta(days=days_to_next_sunday)
|
|
|
|
noon = datetime.time(hour=12)
|
|
|
|
timezone = datetime.datetime.now().astimezone().tzinfo
|
|
next_sunday_noon = datetime.datetime.combine(
|
|
today + delta,
|
|
noon,
|
|
tzinfo=timezone
|
|
)
|
|
|
|
print(next_sunday_noon.isoformat())
|
|
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
main()
|