Last active
October 9, 2017 13:15
-
-
Save rafaelmaeuer/81558c3232dad44a248ef6aecf02ab29 to your computer and use it in GitHub Desktop.
Calculate in-between-time - From https://arduino.stackexchange.com/questions/17477/creating-a-timer-using-a-real-time-clock-with-start-and-stop-times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( | |
( | |
(nowHH > openHH) // check hours first | |
|| ( (nowHH == openHH) && (nowMM > openMM) ) // check minutes if in same hour | |
|| ( (nowHH == openHH) && (nowMM == openMM) && (nowSS >= openSS) ) // check seconds if in same hour & minute | |
) | |
&& // both conditions must be valid | |
( | |
(nowHH < closeHH) // check hours first | |
|| ( (nowHH == closeHH) && (nowMM < closeMM) ) // check minutes if in same hour | |
|| ( (nowHH == closeHH) && (nowMM == closeMM) && (nowSS <= closeSS) ) // check seconds if in same hour & minute | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment