On Oct 6, 8:57 am, Frederick Cheung <[email protected]>
wrote:
> On Oct 6, 6:05 am, boblu <[email protected]> wrote:
>
>
> > my time zone is set like this
>
> > config.time_zone = 'Tokyo'
>
> > I got this from console
>
> > >> temp1.updated_at
>
> > => Tue, 06 Oct 2009 13:26:57 JST +09:00>>
> > temp1.updated_at.to_formatted_s(:db)
>
> > => "2009-10-06 04:26:57">> temp1.updated_at.to_formatted_s(:long)
>
> > => "October 06, 2009 13:26"
>
> > Can anyone tell me why I get different results when using :db
> > and :long in to_formatted_s?
>
> Why would you expect them to be the same ?
>
Oops, hadn't noticed that the time of day was different by 9 hours.
This is almost certainly because ActiveRecord wants to keep things in
the database in UTC.
Fred
> Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---