I want to read a database column value to use in my app.That is t.timestamp.I use it like this: <%=user.created_at-%>,but the displayed time is based on utc while what i want it to be is chinese BeiJing time.How do i manage this? set config.time_zone? The stored time data value is different from the displayed time data value?
on 2008-10-21 04:35
on 2008-10-21 08:13
any one help me?
on 2008-10-21 10:44
I recommend you store the data in your database in UTC format. You can always reformat the data being displayed to local time zone. Have a look at the tzinfo plugin for proper conversion to local time with day light savings, etc http://tzinfo.rubyforge.org/doc/files/README.html .