title: Change Event Within Date Range
body: <p>I am trying to write PHP code to check if a date/time falls within a certain range to render some HTML, and if it doesn't, render some other HTML. Below is my code. If I set the comparisons to a future date, it seems to work fine, &amp; the flag status goes to half staff &amp; then back to full staff according to the parameters. However the next day, about 2-3 hours after the status is set back to full staff, it automatically reverts back to half staff status.</p>
  
  <pre><code>if(date('Y-n-j-G-i') &gt;= '2013-10-9-12-00' &amp;&amp; date('Y-n-j-G-i') &lt;= '2013-10-10-5-00' ) {
  
      echo "&lt;span style='font-size:1.1em'&gt;Governor's Flag Status:&lt;/br&gt; &lt;span style='color:#f00'&gt;Half Staff&lt;/span&gt;&lt;/span&gt;";
  }
  else {
      echo "&lt;span style='font-size:1.1em'&gt;Governor's Flag Status:&lt;/br&gt; &lt;span style='color:#333'&gt;Full Staff&lt;/span&gt;&lt;/span&gt;";
  }
  </code></pre>
  
  <p>I have tried to 'think' through the logic, but it appears I am missing something. Any help would be appreciated.</p>