I have a basic table, current_date field is set to type DATETIME
When I create a record with yii (current_date field set to CURRENT_TIMESTAMP) , it simply enters CURRENT_TIMESTAMP in the table , not the actual date/time .
But when I enter a row by opening sqlitemanager, it works fine .
public function actionCreate() {
$model = new Users;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Users'])) {
$model->attributes = $_POST['Users'];
$model->create_date = date('Y-m-d H:i:s');
if ($model->save())
$this->redirect(array('view', 'id' => $model->id));
}else {
$this->layout = '//layouts/admincolumn2';
$this->render('create', array(
'model' => $model,
));
}
}