title: Rails 3 timezone confusions
body: <p>I'm confused on how rails 3 timezones are supposed to work.</p>
  
  <p>So I config rails to use Pacific time, and tell active record to store in Pacific time.</p>
  
  <pre><code># application.rb
  config.time_zone                      = 'Pacific Time (US &amp; Canada)'
  config.active_record.default_timezone = 'Pacific Time (US &amp; Canada)'
  </code></pre>
  
  <p>Now I submit update a model and this comes through in the params:</p>
  
  <pre><code>"start_at"=&gt;"2013-07-24 00:00:00"
  </code></pre>
  
  <p>From the console now:</p>
  
  <pre><code>&gt;&gt; Sale.last
  =&gt; #&lt;Sale id: 24, start_at: "2013-07-24 00:00:00", ...snipped... &gt;
  
  &gt;&gt; Sale.last.start_at
  =&gt; Tue, 23 Jul 2013 17:00:00 PDT -07:00
  
  &gt;&gt; Sale.last.start_at.in_time_zone
  =&gt; Tue, 23 Jul 2013 17:00:00 PDT -07:00
  </code></pre>
  
  <p>So after trying to force everything to Pacific time, its creating time objects form the database by factoring in the -7 hours of Pacific time.</p>
  
  <p>If I set a time to <code>2013-07-24 00:00:00</code> I would expect <code>Tue, 24 Jul 2013 00:00:00 PDT -07:00</code> to come back out.  And yet it does not.  I was having similar confusing issues when active record was using UTC to store dates. I had a few tests that would fail only after 5pm when time to date conversions yielded a different date.</p>
  
  <p>How do I tame this? Storing UTC dates in the database seems like a good idea, and I can use <code>in_time_zone</code> on time objects for display, but does that means that times in forms must be UTC?</p>
  
  <p>Our application functionality is very tied to server time, and certain thing happen every day as specific times.  So forcing everything to Pacific time seems like it should be fine. But so far I can't seem to make this behave consistently.</p>
  
  <p>How do I make all this not suck?</p>