Home Ask Login Register

Developers Planet

Your answer is one click away!

MonkeyBusiness February 2016

Get days hours minutes from timestamp

How to get days, hours, minutes with javascript(jquery) before some period at future.

Etc. I have timestamp: 1457136000000

How I can find how many days, hours and minutes is until 1457136000000 ?

Answers


Július Retzer February 2016

Have a look at Moment.js library and the diff method:

var a = moment(1457136000000);
var b = moment(); // gets current time
var diff = a.diff(b); //2156483196

diff contains the difference in unix time, you can convert it to any format you like now.

Post Status

Asked in February 2016
Viewed 3,734 times
Voted 9
Answered 1 times

Search




Leave an answer


Quote of the day: live life