[Solved] How to check if time is in the range between two days?
[ad_1] 17:30 comes after 4:00, so anything with start <= x <= end will evaluate to false, because it implies that end (4:00) is larger than start (17:30), which is never true. What you must do instead is check whether it’s past 17:30 or it’s before 4:00: import datetime now_time = datetime.datetime.now().time() start = datetime.time(17, … Read more