strange to_formatted_s problem

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 ?

Fred

> 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