For some reason I can’t save a Time to MySQL. My Column is a datetime and I’ve also tried using a timestamp when I was testing. Here’s my console session below:
$ ./script/console Loading development environment (Rails 2.1.0) >> Event.find 1 # Event id: 1, name: 'Meeting at XXX', start_date: '2009-01-17' >> e.start_date = Time.now => Thu Jan 22 16:40:01 0000 2009 >> e.save => true >> e.start_date => Thu Jan 22 16:40:01 0000 2009 >> e.reload # Event id: 1, name: 'Meeting at XXX', start_date: '2009-01-22'
The time part is just getting ignored in updates and querys.
Turns out it was caused by this old code from from Rails 1 or lower days.
Removing that solved the problem.