title: How to handle date/times in POST parameters?
body: <p>By default, Rails' <code>config.time_zone</code> is UTC. So, fields like <code>created_at</code>, <code>updated_at</code> are saved in UTC.</p>
  <p>Now, presume user's time zone is Pacific Standard Time (PST).</p>
  <p>In order to show dates and times in the user's time zone, I have set <code>Time.zone</code> to PST.</p>
  <p>Now, when a user enters a date (in user's local time zone, which is PST) in a form, that date is received in the controller according to the setting of <code>Time.zone</code>.</p>
  <p>But, I want to save all times in the database in UTC.</p>
  <p>So, how would I go about converting any date/time field in-place in the parameters hash to UTC? I'm wondering if there is a solution where Rails can do the conversion automatically?</p>
  <p>I would like that any date/time received for any datetime field be converted to UTC, without having to write the conversion code in every controller.</p>
  <h3>UPDATE</h3>
  <p>I tested by setting Time.zone to <code>Pacific Time (US &amp; Canada)</code> as well as to <code>Eastern Time (US &amp; Canada)</code> and then saving a model. The <code>created_at</code> time in both cases was in <code>UTC</code>. So that confirms that setting <code>Time.zone</code> has no effect on what time is saved by Rails in the <code>created_at</code> field. That value is effected only by the <code>config.time_zone</code> (which if not defined in <code>application.rb</code> will default to UTC)</p>
  <p>I'm so confused by this all!</p>