CDbExpression

NOW()

Yii::app()->db->createCommand()->insert('table', array( 'title'=> 'title1', 'description'=> 'description1', 'date_now' => new CDbExpression('NOW()'), ));

DATE_FORMAT()

$allRecords2 = Yii::app()->db->createCommand() ->select(array( 'title', 'description', new CDbExpression("DATE_FORMAT(date_now, '%Y-%m-%d') AS dateNowFormat"))) ->from('table') ->queryAll();

или

$dateNow = new CDbExpression("DATE_FORMAT(date_now, '%Y-%m-%d') AS dateNowFormat"); $allRecords = Yii::app()->db->createCommand() ->select('title, description, '.$dateNow.'') ->from('table') ->queryAll();

или

$criteria = new CDbCriteria(); $criteria->select = new CDbExpression("DATE_FORMAT(date_now, '%Y-%m-%d') AS dateNowFormat");