rafaelmaeuer
8/8/2017 - 8:12 AM

Calculate in-between-time - From https://arduino.stackexchange.com/questions/17477/creating-a-timer-using-a-real-time-clock-with-start-and-s

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
  )
)