title: Filter by datetime MYSQL formatting
body: <p>I have a Mysql Table that is used for a log file on the that table there is a field called 'log_date' And it stores the date in the following format( %Y-%m-%d %H:%i.%s ).On the DB the dates look like something this 2013-20-05 00:00.00. Lets say today's date is 2013-20-05 And I have log files from 2013-01-01 to present day. If I run a query like this:</p>
  
  <pre><code>SELECT * FROM log_table
  WHERE STR_TO_DATE(log_date, '%Y-%m-%d %H:%i.%s') &lt; '2013-05-05 00:00.00'
  </code></pre>
  
  <p>This is returning every row in the DB including rows that are greater than 2013-05-05 00:00.00</p>
  
  <p>And if I reverse the &lt; (less then) to a > (greater then) with a query that looks like this: </p>
  
  <pre><code>SELECT * FROM log_table
  WHERE STR_TO_DATE(log_date, '%Y-%m-%d %H:%i.%s') &gt; '2013-05-05 00:00.00'
  </code></pre>
  
  <p>Then it returns ZERO rows. I think the time stamp is what is causing the problem I have worked with the date format before but not the DateTime format. Why is this happening?</p>