UTC for everything, always. Localize the time in rails on the front-
end, but always store and compare in UTC on the back-end.
Trust me, it will make your life a lot easier.
On Oct 25, 9:52 am, Tom Allison 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?
--
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

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 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