OK, so the default time saved is UTF-8.
Which means that storing it a what appears to be now+4 hours is correct.
I think my question falls into a postgresql question.
When I query these fields it appears as the time (16:00 instead of
12:00) is identified as "timestamp with time zone" -- unexpected.  I
don't think I quite understand what it is I am looking at...

On Tue, Oct 25, 2011 at 12:59 PM, Philip Hallstrom <[email protected]> wrote:
>> Just realized I have a nice problem.
>>
>> using Postgresql...
>>
>> When I save something via Rails to the table it's saved with a GMT
>> offset (so 12:00 becomes 16:00)
>> But the database is configured to save everything as GMT.
>>
>> Which means -- when I query it via SQL it's coming back as now + 4
>> hours instead of just plain now.
>>
>> Where/How do I get this back in sync?
>
> Directly via SQL... you can't since that's what the values are.  However, 
> through AR you can...
>
> Not sure if it's moved in 3.1, but in 3.0, the following is in 
> config/application.rb
>
>    # Set Time.zone default to the specified zone and make Active Record 
> auto-convert to this zone.
>    # Run "rake -D time" for a list of tasks for finding time zone names. 
> Default is UTC.
>    config.time_zone = 'Pacific Time (US & Canada)'
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to