HOW TO: Work with and search date fields

Thanks for your fast response, but I still have problems.
I've changed the code to be

//findPreviouslyEntered[TEEntry]
// This method will retrieve all of the entry records
globals.setFromToDates(1); // generates globals.fromdate and globals.todate to be Yesterday and today respectively
var d1 = globals.fromdate;
var d2 = globals.todate;
controller.find();
//userentering = security.getUserName();
dateentered = d1+'...' + d2;
controller.search();

and it yields the following value for the search:
dateentered = Wed Mar 17 12:08:16 EST 2004...Thu Mar 18 12:08:16 EST 2004
the records returned are ALL of the records in the table.

All I want are the records from 3/17/2004 00:00:00 to 3/18/2004 23:59:59
how do I load the find criteria for this date range?