Checking if time is between 6 and 0 (06:00 and 00:00)

If you have more things you want to do based on the time of day, see my Time of Day Design Pattern for a more modular and easier to maintain way to keep track of time periods and trigger or control behaviors based on time like this.

For example, I keep track of four time periods: Night, Morning, Day, and Evening. Some are based on clock time and others are based on sunrise/sunset. Some things trigger when a time of day period starts or stops and some rules change their behavior based on what the current time of day is.