title: Rails and created_at
body: <p>I do:</p>
  
  <pre><code>Order.find(:all, :conditions =&gt; "created_at&gt;='#{DateTime.now.year}-#{month}-1' and created_at&lt;='#{Date.new(DateTime.now.year, month.to_i, -1)}'")
  </code></pre>
  
  <p>That is working fine except that everything created on the last day of the month is not included. Created_at might contain: "2010-09-30 18:34:09". That is NOT less than or equal to "2010-09-30". I know that I could just change the method to this:</p>
  
  <pre><code>Order.find(:all, :conditions =&gt; "created_at&gt;='#{DateTime.now.year}-#{month}-1' and created_at&lt;='#{Date.new(DateTime.now.year, month.to_i, -1)} 23:59:59'")
  </code></pre>
  
  <p>...but that seems kind of wrong. Is there a smarter way to do it?</p>