I found some nice examples to check, if a time is in a specific range, like this one:
now_time = datetime.datetime.now().time()
start = datetime.time(17, 30)
end = datetime.time(4, 00)
if start <= now_time <= end:
In my case, I want to check, if the current time is between 17:30 and 04 in the morning. How am I able to solve this?