title: select all checkboxes at a particular time in html or js
body: <p>I am in need of having a3 checkboxes that should have a tick mark from 2 pm till 11 pm IST in javascript or HTML. This is what I tried</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body&gt;
  &lt;center&gt;
  &lt;span style="margin-left:50px; margin-top:0px;"&gt;
     &lt;p align="left"&gt;&lt;font color="white"&gt; &lt;b&gt; India Time: 2pm to 11pm IST &lt;/b&gt;
    
    &lt;/br&gt;
      &lt;input type="checkbox" id="user1" name="user1" value="user1" &gt; User1&lt;br&gt;
      &lt;input type="checkbox" id="user2" name="user2" value="user2" &gt; User2&lt;br&gt;
      &lt;input type="checkbox" id="user3" name="user3" value="user3" &gt; User3&lt;br&gt;
    &lt;/p&gt;
    &lt;img border="1" src="https://i.postimg.cc/VkPzvHCJ/gh.png" style=" margin-top:-129px;" &gt;
  &lt;/span&gt;
  
  
  &lt;h3 style= "font-family: "Gotham A","Gotham B",sans-serif;&gt;
   &lt;br&gt; &lt;p align="center" style=" margin-top:-30px;"&gt; &lt;font color="#339933"&gt; &lt;b&gt;RStudio Dashboard 
  &lt;/h3&gt;&lt;/P&gt; 
  &lt;/body&gt;
  &lt;script&gt;
   var today = new Date();
   var dd = today.getDate();
   var mm = today.getMonth()+1; //January is 0! 
   var yyyy = today.getFullYear(); 
   if(dd&lt;10){dd='0'+dd} 
   if(mm&lt;10){mm='0'+mm} 
   var today = dd+'/'+mm+'/'+yyyy;
  var holidays = [];
  holidays = ["01/01/2019" , "26/01/2019" , "20/02/2019" , "01/05/2019" , "27/05/2019" , "04/06/2019", "04/07/2019" , "15/08/2019" , "02/09/2019" , "10/09/2019" , "02/10/2019" , "28/11/2019" , "25/12/2019"];
  //var n = str.indexOf("welcome");
  if {
    var startTime = '2:00 PM';
      var endTime = '11:00 PM';
  
      var curr_time = getval();
       //var curr_time = '12:39 AM';
      //alert(curr_time);
      
  
      if (get24Hr(curr_time) &gt; get24Hr(startTime) &amp;&amp; get24Hr(curr_time) &lt; get24Hr(endTime)) {
        //in between these two times
        //alert("Yes")
  
        document.getElementById("sid").checked = true;
        document.getElementById("anil").checked = true;
        document.getElementById("vin").checked = true;
        
        
       
      } else {
       //document.getElementById("user1").checked = true;
       //document.getElementById("user2").checked = true;
      }
  
      function get24Hr(time){
        var hours = Number(time.match(/^(\d+)/)[1]);
        var AMPM = time.match(/\s(.*)$/)[1];
        if(AMPM == "PM" &amp;&amp; hours&lt;12) hours = hours+12;
        if(AMPM == "AM" &amp;&amp; hours==12) hours = hours-12;
  
        var minutes = Number(time.match(/:(\d+)/)[1]);
        hours = hours*100+minutes;
        console.log(time +" - "+hours);
        return hours;
   }
  
      function getval() {
       var currentTime = new Date()
       var hours = currentTime.getHours()
       var minutes = currentTime.getMinutes()
  
       if (minutes &lt; 10) minutes = "0" + minutes;
  
       var suffix = "AM";
       if (hours &gt;= 12) {
          suffix = "PM";
          hours = hours - 12;
       }
       if (hours == 0) {
          hours = 12;
       }
       var current_time = hours + ":" + minutes + " " + suffix;
  
       return current_time;
  
      }
  }
  else
  {
  print ("hello")
  }
  
  &lt;/script&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>This is what I tried. The code is working, but it seems a bit complicated. Is there any simple method?
  The only requirement is to tick the checkboxes from 2 pm to 11 pm IST</p>