18 lines
541 B
Python
18 lines
541 B
Python
import datetime
|
|
import requests
|
|
|
|
def convert_seconds_to_hms(total_seconds):
|
|
hours, remainder = divmod(total_seconds, 3600)
|
|
minutes, seconds = divmod(remainder, 60)
|
|
return hours, minutes, seconds
|
|
|
|
def is_workday():
|
|
return datetime.datetime.today().weekday() < 5
|
|
|
|
def is_game_time():
|
|
# game time is workday 21:00 - 1:00, weekend 10:00 - 1:00
|
|
if is_workday():
|
|
return datetime.datetime.now().hour >= 21 or datetime.datetime.now().hour < 1
|
|
else:
|
|
return datetime.datetime.now().hour >= 10 or datetime.datetime.now().hour < 1
|