I have attached time stamp behavior to my Model as:
public function behaviors()
{
return array(
'CTimestampBehavior' => array(
'class' => 'zii.behaviors.CTimestampBehavior',
'createAttribute' => 'created_date',
'updateAttribute' => 'modified_date',
'setUpdateOnCreate' => true,
),
);
}
It is setting the created and modified date correct while creating the record. While updating it updates the modified date correctly but sets the created date to 0000-00-00 00:00:00. Is there any thing wrong in this code?
I'm using the $Model->update() function for updating the record.