title: how to minus two times while time is in string and 24 hours format
body: <p>I have two time strings and I want subtract them and want to get total minutes.</p>
  
  <pre><code>                var firstHour = dateArray[0];
                  var firstMinutes = dateArray[1];
                  var firstSec = dateArray[2];
                  var secondHour = dateArrayEnd[0];
                  var secondMinutes = dateArrayEnd[1];
                  var secondSec = dateArrayEnd[2];
                  console.log("Hour Differece", secondHour -firstHour);
                  console.log("Mins Differece",firstMinutes - secondMinutes);
                  console.log("Second Differece",firstSec - secondSec );
                  var hours = secondHour -firstHour;
                  var mins= secondMinutes -firstMinutes;
                  var totalMins = (hours *60) + mins;
                  console.log("total mins",totalMins);
  </code></pre>
  
  <p>this is providing me the total minutes, but the problem is if the first hour is 23 and end time 3, then it will show 20 but actually difference should be 4.
  so how can i minus two times??</p>