Better way to determine date
if ( (day &gt; 0 || day &lt; 7) &amp;&amp; (t &gt; 18 || t &lt; 8))


Is this what you want?

Second condition will only be evaluated only if the first one is true. If the first one is true, then only the second one is evaluated.