Convert a form_tag select_datetime to SQL datetime
Posted
by Mitchell
on Stack Overflow
See other posts from Stack Overflow
or by Mitchell
Published on 2010-04-24T09:15:27Z
Indexed on
2010/04/24
9:23 UTC
Read the original article
Hit count: 222
Hi I am trying to make a simple search form that uses a startTime and endTime to specify a time range. The db has a datetime field time that is compared against.
So far when i try to use params[:startTime] in the controller I get an array of values which wont work with :conditions => ['time < ?', params[:endTime]]
Is there a simple solution to parse the form's datetime to SQL datetime?
© Stack Overflow or respective owner