programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
ProgrammingFAQs

how to write criteria to get the data between two dates in symfony

Criteria to get the data

Criteria to get the data with between dates

/*
$c = new Criteria();
$from_date = date('2008-07-07 10:00:00')
$to_date= date("Y-m-d H:i:s");
$criterion = $c->getNewCriterion(UserPeer::CREATED_AT , $from_date, Criteria::GREATER_EQUAL );
$criterion->addAnd($c->getNewCriterion(UserPeer::CREATED_AT , $to_date, Criteria::LESS_EQUAL ));
$c->add($criterion);
$this->users = UserPeer::doSelect($c);

*/