This project is archived and is in readonly mode.

#4895 ✓resolved
Aaron Patterson

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

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

Pages