title: Rails Postgres Time Zone Handling
body: <p>The simple thing I want is to store a DateTime in UTC in the database and retrieve it in UTC again, but rails seems to assume I stored the DateTime in my local time zone and adds the 8 hours difference (PST). I have a DateTime field in my model. If I send a request (PUT) to update this field in a particular instance of my model, somehow timezones get mixed up for whatever reason:</p>
  
  <p>Sending to rails via PUT: 2012-02-17T03:46:58Z</p>
  
  <p>Returned via subsequent GET: 2012-02-17T11:46:58Z</p>
  
  <p>The time difference is exactly 8 hours and could be explained by my timezone which is PST (-08:00). </p>
  
  <p>I am using Datamapper 1.2 on Rails 3.1.3.</p>
  
  <p>I set my application config timezone to UTC explicitly.</p>
  
  <p>I also tried to use dm-zone-types. Did not change anything for me.</p>
  
  <p>A git-bisect on my repo revealed, that this misbehavior was introduced as I switched the database to postgres from the original sqlite. This commit only changed the database.yml and the gemfile. Nothing else.</p>
  
  <p>Any ideas?</p>