使用后$model->save();
取消现有行为DateTimeI18NBehavior
。有谁知道怎么解决?
行为 DateTimeI18NBehavior:http ://www.yiiframework.com/extension/i18n-datetime-behavior/
用户.php(模型):
...
public function behaviors()
{
return array(
'datetimeI18NBehavior'=>array(
'class' => 'ext.DateTimeI18NBehavior',
),
);
}
...
代码:
$criteria = new CDbCriteria;
$model = Users::model()->findByPk('1');
echo $model->birthday;
// Response: 15/10/1900 (right)
代码 2:
$criteria = new CDbCriteria;
$model = Users::model()->findByPk('1');
$model->ip = Yii::app()->request->userHostAddress;
$model->save();
echo $model->birthday;
// Response: 1990-10-15 (wrong)