I need to save the date and time in the bank, but the date returns me in this format 'Mon Jul 30 2018 00:00:00 GMT + 0000' and the bank is '0000-00-00 00:00:00', I recorded it in a string and it goes out of shape in the bank '1532995200000', I tried to format and make several gambi, but it did not work.
AjaxthatsendsthedatatoPHP
$.ajax({type:'POST',data:'title='+title+'&start='+start+'&end='+end+'&allDay='+allDay,url:'agenda/acao.php',success:function(data){$('#title').val('');}});
Phpthatreceivesandwritesdata
$title=$_POST['title'];$start=date('d/m/YH:i:s',$_POST['start']);$end=$_POST['end'];try{$stmt=$pdo->prepare("INSERT INTO events (title, start, end, teste) VALUES(?, ?, ?, ?);");
$stmt->bindValue(1, $title);
$stmt->bindValue(2, $start);
$stmt->bindValue(3, $end);
$stmt->bindValue(4, $start);
$stmt->execute();
} catch (PDOException $e) {
}