fnacimiento and ffallecimiento is date in the table
$personas = TableRegistry::get('Personas')->find();
$personas = $personas->select([
'fnacimiento' => 'date_format(fnacimiento, "%d/%m/%Y")',
'ffallecimiento' => 'date_format(ffallecimiento, "%d/%m/%Y")']);
$this->set('personas', $personas);
I want to move from 0000-00-00
to 00/00/0000 (YYYY-MM-DD to DD/MM/YYYY)
But it is not working it gives me this error:
Error: Call to a member function format() on boolean File …vendor/cakephp/chronos/src/Traits/FrozenTimeTrait.php Line: 161
The query is fine, because in mysql it works, but cakephp has some problem with the format, I do not understand it.