@Mittineague mentioned this exact case. Time is reset on every 0:00.
Yes, but that’s because you are thinking of them as hours. Stop thinking of hours, and just think of numbers, and stop thinking of “later than” and “before”. At this point in your code these are just numbers, not hours.
Yes I am thinking this as hours. Might that why it is not working or I am not able to correct this…
use an analog clock and check every hour: does it come after 21 AND is smaller then 8 - at the same time?
or do it programatically:
Yes. When you think of “01” as an hour, you might think of that as after, or later than, or greater than, “23”, because 1am comes after 11pm. But when you look at “1” as a number, it’s obviously before, or earlier than, or less than, 23.
The solution to this specific comparison problem was mentioned much earlier in the thread if you scroll back.
Or the other way around: it would mean that in your perspective, shivkumar, every hour comes before and after every other hour, always - so without a reset you would have just a bunch of infinity. May be a ruler with 12 or 24 digits would fit better than a clock.
I can’t take much more!
Yes!
In post #40 you changed all the conditions to or
but:-
Only that one condition should be or
because it passes midnight when the clock returns to zero hours. The others should remain as and
.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.