Hi
I have problem with CTimestampBehavior,
this my model
public function behaviors()
{
return array(
'CTimestampBehavior'=>array(
'class'=>'zii.behaviors.CTimestampBehavior',
'createAttribute'=>'create_time',
'updateAttribute'=>'update_time',
)
);
}
protected function beforeSave()
{
$this->tgl_lahir = date('Y-m-d', strtotime($this->tgl_lahir));
$this->create_time = date('Y-m-d', strtotime($this->create_time));
$this->update_time = date('Y-m-d', strtotime($this->update_time));
return TRUE;
}
protected function afterSave()
{
$this->tgl_lahir = date('d-m-Y', strtotime($this->tgl_lahir));
$this->create_time = date('d-m-Y', strtotime($this->create_time));
$this->update_time = date('d-m-Y', strtotime($this->update_time));
return TRUE;
}
the result is 1970-01-01 00:00:00, both create_time and update_time.
what something wrong that I do?
I apologize if this problem have answer some where in this forum, but I have searched and not find the solution