Hi!
I don't understand what you are doing.
In my code if you try set the time as 18:00 to 6:00, you will get this error:
"
The end time can't be smaller than start time!"
If you are converting the time to 12 h format you should use the time from RTC directly not converted time.
Using the web interface you could get this info:
Notice that the last dosage is 18:20 so
reminder is 1100 or (18 * 60) + 20.
Therefore if current time is 18:21 reminder will be 1101 so doing
reminder - curreent time (1100 - 1101) you will get -1.
Using this condition you will avoid negative time after all dosages has been done.
if((reminder - NumMins(t.hour, t.min)) > 0)
Best regards.