title: How to get Time Slot based on 1hour interval
body: <p>I want to store time slot in the arraylist. i have start time and end time. based on start time it should create time slot.
   For example if start time is 09:00AM and end time is 21:00PM then it should add into arraylist like below</p>
  
  <p>09:00AM
  10:00AM
  11:00AM
  12:00PM
  13:00PM
  14:00PM
  ..... so on
  21:00PM</p>
  
  <p>so one user books 13:00PM to 15:00PM slots so it should not be available to another user and other slot should be available. how to compare already booking time with new array list.</p>
  
  <p>Code</p>
  
  <pre><code>    private void getStartHourArray() {
  
      times = new ArrayList&lt;TimeSlot&gt;();
      Calendar calender = Calendar.getInstance();
  
      calender.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
  
      int ti = calender.get(Calendar.HOUR_OF_DAY);
      int minutes = calender.get(Calendar.MINUTE);
  
      System.out.println(minutes);
  
      String[] quarterHours = {
              "00",
  
              "30",
  
      };
      boolean isflag = false;
  
  
      times = new ArrayList&lt;&gt;();
  
      for (int i = 9; i &lt; 22; i++) {
  
          if (ti &gt; 8) {
              for (int j = 0; j &lt; 2; j++) {
  
                  if ((i == ti &amp;&amp; minutes &lt; Integer.parseInt(quarterHours[j])) || (i != ti) || isflag == true) {
  
                      isflag = true;
                      String time = i + ":" + quarterHours[j];
                      if (i &lt; 10) {
                          time = "0" + time;
                      }
                      String hourFormat = i + ":" + quarterHours[j];
                      if (i &lt; 12) {
                          hourFormat = time + " AM";
                      } else
                          hourFormat = time + " PM";
  
                      TimeSlot t = new TimeSlot();
                      t.time = hourFormat;
                      t.isAvailable = "Available";
                      times.add(t);
                  }
              }
          }
  
      }
  
      if (times != null) {
          load.setVisibility(View.GONE);
  
      }
  
  
  }
  </code></pre>
  
  <p>Time Slot model class</p>
  
  <pre><code>public class TimeSlot {
  
  public String time;
   public String isAvailable;
  }
  </code></pre>