title: How to save a timezone correctly with Ruby and MongoId?
body: <p>Please excuse me if this is a bit of a noob issue:</p>
  
  <p>I have an app where users can set their own Timezones in their profile.</p>
  
  <p>When someone adds a Lineup (app specific terminology), I do the following:</p>
  
  <pre><code>time = ActiveSupport::TimeZone.new(user.timezone).parse(
    "Wednesday, 26 October, 2011 13:30:00"
  )
  
  # This outputs: 2011-10-26 13:30:00 +0200 - valid according to the user selected TZ
  </code></pre>
  
  <p>I then save the Lineup:</p>
  
  <pre><code>Lineup.create({
     :date =&gt; time.gmtime,
     :uid  =&gt; user._id,
     :pid  =&gt; product._id
  })
  </code></pre>
  
  <p>This should (in theory) save the date as gmtime, but I get the following when viewing the record:</p>
  
  <pre><code>{
    "_id": ObjectId("4e9c6613e673454f93000002"),
    "date": "Wed, 26 Oct 2011 13: 30: 00 +0200",
    "uid": "4e9b81f6e673454c8a000001",
    "pid": "4e9c6613e673454f93000001",
    "created_at": "Mon, 17 Oct 2011 19: 29: 55 +0200"
  }
  </code></pre>
  
  <p>As you can see the date field is wrong - it still maintaining the user timezone, it should be GMT, not timezone specific.</p>
  
  <p>If I output time.gmtime, I get the right time (that should be saved):</p>
  
  <pre><code>2011-10-26 11:30:00 UTC (correct)
  </code></pre>
  
  <p>Any ideas how to save the GMT date so that it actually saves the GMT date? </p>