我正在尝试通过类型为datetime
的字段start_date ,在TimeSlot
表中查询记录。到目前为止,以下是我的尝试失败的:
TimeSlot.where(:start_date => DateTime.new(2010, 9, 1))
TimeSlot.where(:start_date => DateTime.new(2010, 9, 1).to_s)
TimeSlot.where(:start_date => "2010-09-08")
TimeSlot.where(:start_date => "2010-09-08 00:00:00")
我很感激您的帮助。