Does anyone can link me to some tutorial where I can find out how to return days , hours , minutes, seconds in javascript between 2 unix datetimes?
I have:
var date_now = unixtimestamp;
var date_future = unixtimestamp;
I would like to return (live) how many days,hours,minutes,seconds left from the date_now to the date_future.
Just figure out the difference in seconds (don’t forget JS timestamps are actually measured in milliseconds) and decompose that value:
EDIT code adjusted because I just realised that the original code returned the total number of hours, etc, not the number of hours left after counting whole days.