behnampmdg3 Posted April 29, 2018 Share Posted April 29, 2018 Hi; I have a number like 1525183200, which is a result of strtotime. How can I convert it to days * hours * minutes * seconds so I can add it to the js code? I want to load data for a javascript timer using php.I need to feed it like var deadline = new Date(Date.parse(new Date()) + days * hours * minutes * seconds * 1000); Thank you Link to comment Share on other sites More sharing options...
requinix Posted April 29, 2018 Share Posted April 29, 2018 1525183200 is a date, not an amount of time. var deadline = new Date(1525183200 * 1000); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.