A quick question on how i pass a timestamp from SQL trough PHP into JavaScript and then convert it into a unix timestamp.
The goal here is so retrieve a timestamp from my DB to which i add X hours and set is as endtime for my clock.
JavaScript
var deadline = new Date(Date.parse(new Date()) + 15 * 24 * 60 * 60 * 1000);
initializeClock('clockdiv', deadline);
PHP (time.php)
$sql = "SELECT max(time), time FROM user'";
foreach ($pdo->query($sql) as $row) {
echo date($row['time']);}
I get the time using
$('#sqltime').load('time.php');
But i am absolutely not sure how to