bennouna, on 28 April 2012 - 10:53 AM, said:
It seems your form input is ok. But you say you have an error with beforeSave, I think you should post your code, and the exact error output to help us help you
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