Issue with db_query related to date I am using created date of ubercart order to compare with filter selected values of date. 

created date is in timestamp with time. Where as filter selected values it is just date and if try to convert the date to timestamp, its not fetching accurate results as per filtered dates.

I have attached the image for clear understanding.





I have used this as query: 

$query = $query-&gt;condition('uc.created',array($from_timestamp,$to_timestamp),'BETWEEN');

Any suggestions ? Thanks in advance.
Instead of using different select boxes for month, date and year, you could use date_popup type.

$form['start'] = array(
    '#title' =&gt; t('Arrive'),
    '#type' =&gt; 'date_popup',
    '#default_value' =&gt; 'YYYY-MM-DD 00:00:00',
    '#date_year_range' =&gt; '0:+3',
    '#size' =&gt; 12,
    '#required' =&gt; true,
  );


Which comes with time field, so you will have the timestamp. Thats it, now you can compare the timestamp input to the database value.