On Jul 28, 1:28 pm, Daniel Waite
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> I ask these questions because I have a scenario whereby an AR-backed
> object, when issued the "published_at" method yields a date like
"Tue
> Jul 28 17:04:58 UTC 2009". However, when *finding* the object, e.g.
> Object.first, I get what looks like a UTC date: "2009-07-28
17:07:11".
> (That is, when you find an object in console it shows you all its
> attributes, and it is in there that I have what I think is a UTC date.)
>
> So... what''s the deal?
See:
http://ryandaigle.com/articles/2008/1/25/what-s-new-in-edge-rails-easier-timezones
Essentially, times recorded in the database by AR are now always in
UTC. The default time_zone is used to convert the DB values from UTC
for local display. The default TZ can be dynamically overridden in
the application to permit individual users to have times displayed in
their own locale TZ.
HTH