Skip to content Skip to sidebar Skip to footer

Date From Mysql Db To Javascript Timer

I have a timer script in JS and i want to grab data from Mysql DB but is not working, here is what i do so far.. My date format from expirydate DB is numeric: '1527886800' PHP: &l

Solution 1:

You cannot use the PHP variable directly in the JS code. You need to do something like:

var endTime = new Date("<?php echo $mysqldate; ?>");

Post a Comment for "Date From Mysql Db To Javascript Timer"