title: PHP Compare datetime values
body: <p>In my PHP application I'm trying to compare date time values like the following:</p>
  
  <pre><code>if($datetime_from_db &lt; date('Y-m-d H:i:s'))
  {
      // then do something
  }
  </code></pre>
  
  <p>Both values are in the same format. What I can't figure out is why it only compares the date and ignores the time. Both the date and the time values are important for me but I don't know how to make it work.</p>