views:

24

answers:

1

I have a problem when showing a datetime object from the database. The time is correctly set in when storing the object, but when it is fetched from db and shown to user it is shown in UTC

environment.rb

config.time_zone = 'Copenhagen'

This is what is saved using Time.now or Time.zone.now

2010-07-08 13:59:50 +0200

This is what is shown to the user when using the html helper <%=h ff.date_registered %> 2010-07-08 11:59:50 UTC

A: 

This is because TimeZone for the Rails & mySql is set to different.

Ref this beautiful artical time-zone-support-an-overview.

Salil
I have read that blog, but i fail to see the answer for my question
Flexo