The Mongo driver and various ORMs handle Date, Time, and DateTime objects just fine; there is no reason to throw them in lines.
Col.create(:created_at => another_model.created_at)
And find:
Col.all(:created_at => another_model.created_at)
You do not want to set strings because dates are stored inside the BSON Date object and are indexed and searched as such. If you save them as strings, you will not be able to efficiently perform actions such as more / less than comparison / range.
source share