I want to convert HH:MM to MM I want to use minutes in below code but It can't convert 14:30 to 858 as you can see result here in fiddle minutes but it converts 14.3 to minutes if you put 14.3 in fiddle code instead of 14.30.
I am converting hrs. in minutes than I am Lessing 240 minutes from minutes I got How can I convert this hrs. in minute. below is the code I am trying to convert hours to minutes
NOTE: hours can be can be any Time from 0 to 23 it could be 2:30 or it could be 10:30
function convertHourstoMinute(hours) {
return Math.floor(hours * 60);
}
let hrs = convertHourstoMinute(14:30); // convert hours into minutes javascript
console.log( "javascript convert hours to minutes :- " + hrs );
let minutes = hrs * 60;
console.log(minutes)
let callback_time = minutes - 240
console.log(callback_time)
let call_back = callback_time / 60
console.log(call_back)