how to get the duration time in date that has a time.
e.g start date and time: 2017-07-27 10:31 end date and time: 2017-07-28 15:11
(start date and time) - (end date and time) = total.
after getting the differences it should be convert into time.
how to get the duration time in date that has a time.
e.g start date and time: 2017-07-27 10:31 end date and time: 2017-07-28 15:11
(start date and time) - (end date and time) = total.
after getting the differences it should be convert into time.
You have to use this :
const total = a.getTime() - b.getTime()
You can do this by taking the start time from the end time
var startDate = new Date("2017-07-27 10:31");
var endDate = new Date("2017-07-28 15:11");
var durationSeconds = (endDate - startDate) / 1000;
From the seconds you can work out the minutes, hours etc.