diff --git a/www/protected/models/Candidato.php b/www/protected/models/Candidato.php index f242788..55b83a0 100644 --- a/www/protected/models/Candidato.php +++ b/www/protected/models/Candidato.php @@ -305,8 +305,10 @@ class Candidato extends CActiveRecord { //PHP dates are displayed as dd/mm/yyyy //MYSQL dates are stored as yyyy-mm-dd + if ($this->fecha_nacimiento != '') { $unafecha = DateTime::createFromFormat('d/m/Y', $this->fecha_nacimiento); $this->fecha_nacimiento = $unafecha->format('Y-m-d'); + } parent::beforeSave(); return true;