I have a timestamp given by a JSON. I want to push this into my database (MySQL). There is a row called "epoch" which is a date time type.
Printing the timestamp by the following code results in the correct result.
$epoch = date('d.m.Y H:i:s', $this->date);
echo "Timestamp: " . $this->date . " - Date: " . $epoch . "
";
Timestamp: 1446746400 - Date: 05.11.2015 19:00:00
$sql = "REPLACE INTO Forecast (epoch) VALUES ('" . $this->date . "')";
Result is a 0000-00-00 00:00:00 Date Value in my DB...
Can anybody explain me, how to pass this timestamp correctly into MySQL?