I know your pain.

Daylight savings started on march 13th of 2011.  Both the dates are Pacific
time, one is accounting for daylight savings (PDT), as it's in April.

Hope this helps.

--Dan


On Thu, Jan 17, 2013 at 2:48 PM, Benjamin Wanicur <[email protected]>wrote:

> Hi Everyone
>
> I have a real head-scratcher with some information I am getting back in
> console when I fetch some model objects from the Postgres DB for a Rails
> app.
>
> Here is some relevant info:
>
> from config/application.rb
>  config.time_zone = "Pacific Time (US & Canada)"
>
> here is the postgres schema info relevant for the model in question:
>  created_at              | timestamp without time zone |
>
> here is the raw sql data:
> select id, created_at from lots where id IN (37, 46);
>  id |         created_at
> ----+----------------------------
>  46 | 2011-04-05 00:25:44.849625
>  37 | 2011-02-02 20:08:13.219216
>
> here is the output from console that has me confused:
> 1.9.2-p290 :055 > Lot.find(46).created_at
>  => Mon, 04 Apr 2011 17:25:44 *PDT -07:00 *
> 1.9.2-p290 :056 > Lot.find(37).created_at
>  => Wed, 02 Feb 2011 12:08:13 *PST -08:00 *
>
>
> It's been awhile since I've wrangled with time zones, but my understanding
> is that that Rails should always display the timestamp information in the
> time zone that is set by config.time_zone .  There is no code in the model
> file that should set any kind of time zone for an instance.  So I am
> wondering why one instance of Lot comes back with a created_at in PST and
> the other in PDT ?
>
> I am forgetting something really basic here ?
>
> Thanks for your help
>
> Ben
>
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to