title: calculation between two time slots javascript
body: <p>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.</p>
  <pre><code>const currentTime = new Date();
      const timeMinutes = currentTime.getMinutes()
      
      if(timeMinutes &lt; 10){
          var timeMinute = '0' + timeMinutes
      }else{
          timeMinute = timeMinutes
      }
  const heureCommande = currentTime.getHours() + &quot;:&quot; + timeMinute
      console.log(heureCommande)
  console.log(heureCommande - 18:50)
  </code></pre>