Jump to content

How can I get the number of days, hours, minutes and seconds from epoc?


behnampmdg3

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.