title: Rails timestamps don't use the right timezone
body: <p>I'm a bit confused about timezones in rails.  I want my rails app to use British Summer Time (like daylight savings in the US) for the timestamps set in updated_at and created_at in my models.  I changed my environment.rb to say </p>
  
  <pre><code>  config.time_zone = 'London'
  </code></pre>
  
  <p>The ubuntu server my app is on seems to use BST for it's time: in the command line, for example, if i type 'date' i get the current time (not offset by an hour).  In the rails console, i see the following:</p>
  
  <pre><code>&gt;&gt; time = Time.now
  =&gt; Wed Oct 27 16:29:17 +0100 2010
  &gt;&gt; time.zone
  =&gt; "BST"
  </code></pre>
  
  <p>All fine.  However, if i make a new AR model object and save it, the timestamps are from an hour ago.  So, it looks like this is using UTC.  Now, i can see the logic in this: since the timestamps might be used in the model logic, you want them to be based on an unvarying yardstick time, ie UTC.   But, this is a weird bit of behaviour that i don't understand:</p>
  
  <pre><code>#change a record and save it
  &gt;&gt; someobj.save
  =&gt; true
  #object's updated_at is one hour ago
  &gt;&gt; someobj.updated_at
  =&gt; Wed, 27 Oct 2010 15:34:22 UTC +00:00
  &gt;&gt; Time.now
  =&gt; Wed Oct 27 16:34:31 +0100 2010
  #however, Time.now - object's updated at is just a few seconds.
  &gt;&gt; Time.now - someobj.updated_at
  =&gt; 15.305549
  </code></pre>
  
  <p>So, before doing the subtraction, updated_at is converted into the current time zone.  </p>
  
  <p>The reason i want to show the date in the current time zone is just for status reports etc in the views: if someone updates something i want them to see that it was updated '1 minute ago' not 'one hour ago'.</p>
  
  <p>Can anyone unconfuse me?  cheers, max</p>
  
  <p>EDIT: My immediate problem, of showing the right time in the status, is solved by using the 'time_ago_in_words' helper, which adjusts for time zone.  I'd still like someone to explain what's going on with the timestamps though :)</p>