If you made it this far in the post, you’ve probably figured out that there is a problem using $time24.
In morning hours, time24 returns 0:15, 1:15, 2:15, 3:15, etc. There is no leading zero so a 3:15 returns higher than something like 13:15, because the 3 is higher than the 1 in 13. Faulty logic.
Okay, how to fix: Convert military time into # of minutes since midnight.
Create a variable called CurrentTime. Default it with the expression (($hour24 * 60) + $minute). Use CurrentTime in place of all your $time24.
This will give you a result in minutes since midnight. Convert all your time variable to integers and calculate the time since midnight. Enter that as the value.
My 6:30 am variable is now “390”, which is (60 * 3 + 30).