title: How to switch the time to different time when the current is equal to the start time
body: <p>I need to switch this time start time 11:55 and end time 12:10 to start time 12:55 to end time 13:10 when the first start time 11:55 and end time 12:10 is call how do I do that in JavaScript, because I'm new to JavaScript
  This is the code:</p>
  
  <pre><code>var myVar = setInterval(checktime ,5000);
  function checktime()
  { 
  var currentD = new Date();
  //this si the start and end time i have set for starting
  var startHappyHourD = new Date();
  //startHappyHourD.setHours(11,55,00);
  var endHappyHourD = new Date();
  //endHappyHourD.setHours(12,10,00); 
  
  // then it will check
  if(currentD &gt;= startHappyHourD &amp;&amp; currentD &lt; endHappyHourD)
  {
     var temp = startHappyHourD.toLocaleTimeString();
      alert(temp);
  
  }
  if(currentD &gt;= endHappyHourD)
  {   
      var temp2 = endHappyHourD.toLocaleTimeString();
      alert(temp2);
      stopCheck();
      // after check, it suppose to check here and change the time i dont know why it wont work
      if(startHappyHourD.getHours().getMinutes().getSeconds() == "11:55:00")
      {
              startHappyHourD.setHours(12,55,00);
              endHappyHourD.setHours(13,10,00);
  
      }
  </code></pre>