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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 7 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 25, '11 at 4:53p
activeOct 28, '11 at 11:34p
posts7
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase