heroku time zone problem
- by Ole Morten Amundsen
Why does Time.now yield the server local time when I have set the another time zone in my environment.rb
config.time_zone = 'Copenhagen'
I've put this in a view
<p> Time.zone <%= Time.zone %> </p>
<p> Time.now <%= Time.now %> </p>
<p> Time.now.utc <%= Time.now.utc %> </p>
<p> Time.zone.now <%= Time.zone.now %> </p>
<p> Time.zone.today <%= Time.zone.today %> </p>
rendering this result on my app at heroku
Time.zone (GMT+01:00) Copenhagen
Time.now Mon Apr 26 08:28:21 -0700
2010
Time.now.utc Mon Apr 26 15:28:21 UTC
2010
Time.zone.now 2010-04-26 17:28:21
+0200
Time.zone.today 2010-04-26
Time.zone.now yields the correct result. Do I have to switch from Time.now to Time.zone.now, everywhere? Seems cumbersome. I truly don't care what the local time of the server is, it's giving me loads of trouble due to extensive use of Time.now. Am I misunderstanding anything fundamental here?