function before save is same with the code that you type before,
protected function beforeSave()
{
list($c_date, $s, $c_time) = explode(' ', $this->degon);
list($c_d, $c_m, $c_y) = explode('/', $c_date);
list($c_h, $c_i, $c_s) = explode(':', $c_time);
$this->degon = date('Y-m-d H:i:s', mktime($c_h, $c_i, $c_s, $c_m, $c_d, $c_y));
list($c_date, $s, $c_time) = explode(' ', $this->degoff);
list($c_d, $c_m, $c_y) = explode('/', $c_date);
list($c_h, $c_i, $c_s) = explode(':', $c_time);
$this->degoff = date('Y-m-d H:i:s', mktime($c_h, $c_i, $c_s, $c_m, $c_d, $c_y));
return parent::beforeSave();
}
i try this command first, but get error offset 2
then i try another code to make the date format look like my data ( 28/02/2012 15:22 ) :
protected function beforeSave()
{
list($c_date, $s, $c_time) = explode(' ', $this->degon);
list($c_d, $c_m, $c_y) = explode('/', $c_date);
list($c_h, $c_i, $c_s) = explode(':', $c_time);
$this->degon = date('dd/MM/yyyy H:i:s', mktime($c_h, $c_i, $c_s, $c_m, $c_d, $c_y));
list($c_date, $s, $c_time) = explode(' ', $this->degoff);
list($c_d, $c_m, $c_y) = explode('/', $c_date);
list($c_h, $c_i, $c_s) = explode(':', $c_time);
$this->degoff = date('dd/MM/yyyy H:i:s', mktime($c_h, $c_i, $c_s, $c_m, $c_d, $c_y));
return parent::beforeSave();
}
but still produce the same error