Where is the Rails method that converts data from `datetime_select` into a DateTime object?

This conversion happens within ActiveRecord when you save your model.

You could work around it with something like this:

somedate = DateTime.new(params["date1(1i)"].to_i, 
                        params["date1(2i)"].to_i,
                        params["date1(3i)"].to_i,
                        params["date1(4i)"].to_i,
                        params["date1(5i)"].to_i)

DateTime::new is an alias of DateTime::civil (ruby-doc)

Leave a Comment