Hello,
I am stuck on this, I have in my model:
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => new Expression('NOW()'),
],
];
}
Which returns:
2015-04-24 21:17:07.000000
But I need:
2015-04-24 21:17:07
How can I remove all the zero and dot using the rules please?
public function rules()
{
return [
[['name'], 'required'],
[['created_at', 'updated_at'], 'safe'],
[['name'], 'string', 'max' => 45]
];
}
Thank you!
Ben