Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Last active October 9, 2017 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelmaeuer/81558c3232dad44a248ef6aecf02ab29 to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/81558c3232dad44a248ef6aecf02ab29 to your computer and use it in GitHub Desktop.
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