0

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.

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
Pavankumar AN
  • 55
  • 1
  • 12

1 Answers1

3

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);
Cmdd
  • 867
  • 1
  • 10
  • 22