title: Get all records created today in Rails
body: <p>I want to get all the records from the database which are create_at today. But when I do </p>
  
  <pre><code>Model.where('DATE(created_at) = ?',Date.today)
  </code></pre>
  
  <p>it returns only the last record that is created today. I have 3 records with created_at </p>
  
  <pre><code>2015-03-03 11:38:31
  2015-03-03 11:59:00
  2015-03-03 11:33:04
  </code></pre>
  
  <p>. But it returns only the record with '2015-03-03 11:38:31' this created_at date. </p>
  
  <p>Also referred <a href="https://stackoverflow.com/questions/9864735/how-to-delete-all-records-created-today">How to delete all records created today?</a>, <a href="https://stackoverflow.com/questions/10871800/getting-all-rows-created-today">Getting all rows created today</a>. I want to know why is this happening? 
  Also tried</p>
  
  <pre><code> Model.where("DATE(created_at) = ?",Date.today)
  </code></pre>
  
  <p>and</p>
  
  <pre><code> Tracking::TrackingLogin.where("created_at &gt;= ?", Time.zone.now.beginning_of_day)
  </code></pre>
  
  <p>Please someone explain what is happening in my code?</p>