в базе поля INT 'create_time','update_time',
Behaiors в модели
Код: Выделить всё
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'create_time',
'updatedAtAttribute' => 'update_time',
'value' => new Expression('NOW()'),
],
];
}
Если делаю такError Info: Array
(
[0] => 22003
[1] => 1264
[2] => Out of range value for column 'create_time' at row 1
)
Код: Выделить всё
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
],
];
}