Rails 3 has good TimeZone support built in, but you have to use the right Date and Time classes to get full support.
If you have this set in your application.rb config.active_record.default_timezone = :local
, then you really need to use Time so that it properly identifies itself as being in the local timezone and not in UTC when passing to the database insert.
1 2 3 4 5 6 7 8 |
|
So basically, Time.parse always returns the value in the local timezone, DateTime.parse always returns the value in UTC. To get complete compatibility, always use Time.parse. Trust me, I learned the hard way :)