code: protected void setCalendarHour(Calendar cal, int hour) {
      cal.set(Calendar.HOUR_OF_DAY, hour);
      if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
        cal.set(Calendar.HOUR_OF_DAY, hour + 1);
      }
    }
docs: Advance the calendar to the particular hour paying particular attention to daylight saving problems.
  
  @param cal
  @param hour