I have to get the difference of present timings(eg:1579770577465) and some planned time(eg:1579768500000) and I need to convert into minutes. How I can do it?
1579770577465 - 1579768500000 = 2077465
I want 2077465 in minutes.
I have to get the difference of present timings(eg:1579770577465) and some planned time(eg:1579768500000) and I need to convert into minutes. How I can do it?
1579770577465 - 1579768500000 = 2077465
I want 2077465 in minutes.
Here you go:
var deltaMs = msData2 - msData1;
var totalSeconds = parseInt(Math.floor(deltaMs / 1000), 10);
var totalMinutes = parseInt(Math.floor(totalSeconds / 60), 10);
var totalHours = parseInt(Math.floor(totalMinutes / 60), 10);
var days = parseInt(Math.floor(totalHours / 24), 10);
var seconds = parseInt(totalSeconds % 60, 10);
var minutes = parseInt(totalMinutes % 60, 10);
var hours = parseInt(totalHours % 24, 10);