This project is archived and is in readonly mode.
Ruby's time zone detection does not agree with PostgreSQL sometimes
Reported by Aaron Patterson | June 18th, 2010 @ 12:28 AM | in 3.x
On PostgreSQL 84, Postgres seems to detect the local timezone differently than Ruby does. When selecting dates from PostgreSQL, it automatically converts the date to the local timezone. Unfortunately, the way it detects the current UTC offset is different than the way Ruby does. That means that when the date is parsed by ruby, it ends up with the wrong offset.
I've attached a patch that fixes the test, but it's important that people make sure to do one of the following:
1) Always use UTC timezones in rails
2) Make sure that Ruby and PostgreSQL agree on the machine's timezone
Comments and changes to this ticket
-
Aaron Patterson June 18th, 2010 @ 12:30 AM
- no changes were found...
-
Aaron Patterson June 18th, 2010 @ 12:40 AM
This patch sets the timezone in postgres to what ruby thinks the timezone is, unless the user has specified UTC.
-
Repository June 18th, 2010 @ 01:18 AM
- State changed from new to resolved
(from [bf6661c5d75d8e29ebd5f6011f97a85c892663a0]) setting the timezone in postgres to whatever ruby thinks the timezone is [#4895 state:resolved]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/bf6661c5d75d8e29ebd5f6011f97a8...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4895 Ruby's time zone detection does not agree with PostgreSQL sometimes (from [bf6661c5d75d8e29ebd5f6011f97a85c892663a0]) setting...