ActiveRecord 3+ auto-converts times to UTC by default. Hilarity ensues.

Posted Over 12 years ago. Visible to the public.

Remember how Rails 2 came with an awesome feature that broke all code using Time.now or Time.parse?

This behavior is now the default for Rails 3. Disable it by adding the following to your config/application.rb:

config.active_record.default_timezone = :local
config.active_record.time_zone_aware_attributes = false    
Henning Koch
Last edit
About 7 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2011-09-05 14:17)