'calculation between two time slots javascript

calculation between two time slots, I retrieve a time from my database example: 11:50 and the current time is 18:50. How to calculate interval between the two schedules? thank you for help.

const currentTime = new Date();
    const timeMinutes = currentTime.getMinutes()
    
    if(timeMinutes < 10){
        var timeMinute = '0' + timeMinutes
    }else{
        timeMinute = timeMinutes
    }
const heureCommande = currentTime.getHours() + ":" + timeMinute
    console.log(heureCommande)
console.log(heureCommande - 18:50)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source