I have a function to convert the date, but it is returning an error that I could not adjust:
Follow the code below:
<?php
class Prog{
private $DtBase;
public function setdata($DtBase){
$this->data = $DtBase;
}
public function getdata(){
return convertData($this->data);
}
public function convertData($data){
$data = Datetime::createFromFormat('d/m/Y', $data);
return $data->format('Y-m-d');
}
}
?>
Error calling function convertData :
Call to undefined function convertData () in Prog.php on line 11
Any tips?