create_date is not working

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

Erm, you do not need to set the create_time and update_time attributes of your model yourself. So you can safely leave them alone in the beforeSave() and afterSave() methods. The CTimestampBehavior will take care of them by itself ;)

this case same with me. this is a system time. please search about unix timestamp. you will know the reason

it is will be help you

http://www.yiiframework.com/forum/index.php?/topic/20840-alter-the-incoming-variables-of-active-record/page__p__102068__hl__1970#entry102068