cakePHP ‘created’ truncated to the date only
September 7, 2010 by Ayo Akinyemi · Leave a Comment
$this->yourTableName->find(“all”,array(‘conditions’ => array(‘yourTableName.id’ => $this->params['pass'][0], ‘DATE(yourTableName.created) ‘ => date(“Y-m-d”,strtotime(“-0 day”)))));
‘created’ DB column name in cakePHP has a datetime format. the code finds record using the date(“Y-m-d”) condition.
