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 Quote 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.