title: Time.now.midnight's susceptibility to time zones
body: <p>I have some daily analytics-style records that track usage on my site, and they work as follows:</p>
  
  <ul>
  <li>When an 'event' occurs, the site looks for a record that was created at <code>Time.now.midnight</code>.</li>
  <li>If such a record is not found, a new one is created, and <code>created_at</code> is set to <code>Time.now.midnight</code>.</li>
  </ul>
  
  <p>Here's the question - does <code>Time.now.midnight</code> get recorded differently depending upon the client's time zone? If so, am I correct in assuming that the above very simple system will break down? </p>
  
  <p>How can I fix it so all analytics records, irrespective of the time zone of the user who triggered their creation, get pegged to one time?</p>
  
  <p>Note: I imagine that setting the <code>created_at</code> field to a Date instead of Datetime might have been better in this scenario. Let's assume we're stuck with datetime for this question.</p>