HOW TO: Work with and search date fields

this should work:

globals.setFromToDates(1)

var d1 = globals.fromdate
d1.setHours(00) 
d1.setMinutes(00) 
d1.setSeconds(00)
var df1 = utils.dateFormat(d1, 'MM-dd-yyyy hh:mm:ss')  

var d2 = globals.todate
d2.setHours(23) 
d2.setMinutes(59) 
d2.setSeconds(59) 
var df2 = utils.dateFormat(d2, 'MM-dd-yyyy hh:mm:ss') 

controller.find() 
dateentered = df1+'...' + df2+'|MM-dd-yyyy hh:mm:ss'  
controller.search()