0

I have a Rails 2.3 app that is full of data timestamped with the local timezone (EST) as was the convention with Rails 2.3. The problem is that now I am upgrading to Rails 3.2 and I want to avoid going and updating all those timestamps to UTC which is the Rails 3.2 convention. What is the best approach? I can't seem to figure out a way to tell Rails that the data in the database is in the EST timezone so it can appropriately accomodate timezones calculations. Surely others have run into this? Thanks!

Tom Rossi
  • 11,604
  • 5
  • 65
  • 96
  • 1
    does this helps? http://stackoverflow.com/questions/6118779/how-to-change-default-timezone-for-activerecord-in-rails3 perhaps you can tell us what have you tried and where are you stucked? – M.Octavio Mar 20 '13 at 16:45

1 Answers1

0

Got it working! This was the configuration that needed to be added:

application.rb:

config.time_zone = 'Eastern Time (US & Canada)'
config.active_record.default_timezone = :local

Now it assumes the data in the database is in the local timezone specified as 'Eastern Time (US & Canada)'.

Tom Rossi
  • 11,604
  • 5
  • 65
  • 96