title: Rails Postgresql Time Column
body: <p>I've got 2 Time Without Time Zone columns in my table (<code>start_time</code> and <code>end_time</code>).  When an event occurs, I need to see which of these columns has a <code>start_time &lt; Time.now &lt; end_time</code>.  The problem seems to be that Rails is not saving the Time in UTC and is instead saving the time exactly as I enter it in my field.  My local timezone is <code>UTC -5</code>, so if I put in an <code>end_time</code> of <code>09:00:00</code>, I would expect that to get saved to the database as <code>14:00:00</code>, but it's getting saved as <code>09:00:00</code>, so when I later run my <code>start_time &lt; Time.now &lt; end_time</code> query, I'm getting the wrong results (I'm off by those 5 hours).</p>
  
  <p>Here's an example (the model is called TimeParameter):</p>
  
  <pre><code>1.9.3-p392 :001 &gt; TimeParameter.create(start_time: "00:30:00", end_time: "09:00:00")
     (7.0ms)  SELECT * FROM geometry_columns WHERE f_table_name='time_parameters'
     (0.2ms)  BEGIN
    SQL (9.8ms)  INSERT INTO "time_parameters" ("created_at", "day_of_week", "end_time", "start_time", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["created_at", Tue, 23 Jul 2013 14:29:06 UTC +00:00], ["day_of_week", nil], ["end_time", 2000-01-01 09:00:00 UTC], ["start_time", 2000-01-01 00:30:00 UTC], ["updated_at", Tue, 23 Jul 2013 14:29:06 UTC +00:00]]
     (308.9ms)  COMMIT
   =&gt; #&lt;TimeParameter id: 24, start_time: "2000-01-01 00:30:00", end_time: "2000-01-01 09:00:00", day_of_week: nil, created_at: "2013-07-23 14:29:06", updated_at: "2013-07-23 14:29:06"&gt; 
  </code></pre>
  
  <p>Local time is ~09:30, UTC is ~14:30
  Notice that the <code>updated_at</code> and <code>created_at</code> reflect the <code>14:30</code> UTC time but my <code>start_time</code> and <code>end_time</code> are not converted to UTC before being saved.</p>
  
  <p>Ruby version: 1.9.3-p392</p>
  
  <p>Rails version: 3.2.13</p>