Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Ruby's time zone detection does not agree with PostgreSQL sometimes

#4895

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

Reported by Aaron Patterson · June 18th, 2010 @ 12:28 AM

State: resolved
Milestone: 3.x
Assigned to: nobody
Importance: Low

Activity

  1. Aaron Patterson
  2. Aaron Patterson
    Aaron Patterson

    This patch sets the timezone in postgres to what ruby thinks the timezone is, unless the user has specified UTC.

    June 18th, 2010 @ 12:40 AM

  3. Repository
    Repository
    • State changed from new to resolved

    June 18th, 2010 @ 01:18 AM