title: PHP/MySQL Date and Time comparison (without seconds)
body: <p>I created a DateTime Object with PHP and inserted it into the database column scheduled time - as this: <code>2017-03-13 07:30:00</code></p>
  
  <p>Now I want to run a query and select the rows which have the same time or the time is less than the current time - assuming the current time is <code>2017-03-13 08:30:00</code>. I want to ignore the seconds because those doesn't matter. </p>
  
  <p>I do this:</p>
  
  <pre><code>SELECT * FROM fp_mail_reminder
          WHERE DATE_FORMAT(scheduledtime, '%d.%m.%Y %k:%i') &lt;= DATE_FORMAT('2017-03-13 08:30:00', '%d.%m.%Y %k:%i')
          AND active = 1
          ORDER BY id ASC
  </code></pre>
  
  <p>However the query does not result a row which has been inserted with 2017-03-13 07:30:00. If I change the date as this: 2017-03-12 07:30:00 - so I change the day, the result is coming up.</p>
  
  <p>Can anybody say why this is the case?</p>