0
I need to receive a date using the datapicker as dd/mm/yyyy and switch to database format (mysql).
have the access methods (Getter and Setter) in them applied this date function and 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 in the bank saved 0000-00-00
And when making the query returns: 01/01/1970
.
I’ve searched a lot including some form here in stackoverflow and none worked.
Enter the code (SQL) of how you save the date
– rray
$sql = "INSERT INTO spent (datavenc, input date)" . " VALUES(:datavenc, :input date)";
– JB_
you go from ta to format
d/m/Y
orY-m-d
?– rray
Step via input type="text" using the datapicker as
d/m/Y
I need it to reach the bank in formatY-m-d
and then do the recovery to display the input as`d/m/Y'– JB_