I have two time without date
var startTime=\"12:16:59 am\"; var endTime=\"06:12:07 pm\";
I want to show the total hours in between the abov
myStart = "01:30:00 am"; myEnd = "2:45:07 am"; function getTimeDiff(start, end) { return moment.duration(moment(end, "HH:mm:ss a").diff(moment(start, "HH:mm:ss a"))); } diff = getTimeDiff(myStart, myEnd) console.log(`${diff.hours()} Hour ${diff.minutes()} minutes`);