I need to receive a date using the datapicker as dd / mm / yyyy and switch to the accepted format in the database (mysql).
I have the accessor methods (Getter and Setter) in them I applied this function date and the strstring to convert:
function setDatavenc($datavenc) {
$this->datavenc = date('d/m/Y', strtotime($datavenc));
}
.
function getDatavenc() {
return date('d/m/Y', strtotime($this->datavenc));
}
But when saving to the bank saves 0000-00-00
And when doing the query returns: 01/01/1970
.
I've even looked for some form here in stackoverflow and none worked.