I have two inputs of time and I want to get the difference/time-interval between these two using dayjs
fromtime = '13:00'
totime = '17:00'
So the output for the above two should be 4:00
hours
I tried
console.log(
dayjs(fromtime).diff(dayjs(totime), "hours")
);
But am not getting the expected output.
Best Answer
I found the solution to this.
This will give the output as
totalHours = 1
andtotalMins = 10
.Hope this help someone.