title: RRULE in android
body: <p>I am trying to set weekly monday reminder in calendar at 9 a.m.
  Following is the code</p>
  <pre><code>final int[] preTimings = {9, 12, 18};
  
  Calendar calendar = Calendar.getInstance(Locale.getDefault());
  ContentValues newEvent = new ContentValues();
  
  int month = calendar.get(Calendar.MONTH);
  int date = calendar.get(Calendar.DATE);
  
  calendar.set(Calendar.MONTH, month);
  calendar.set(Calendar.DATE, date);
  calendar.set(Calendar.MINUTE, 0);
  calendar.set(Calendar.SECOND, 0);
  calendar.set(Calendar.MILLISECOND, 0);
  
  for(int i = 0; i &lt; preTimings.length; i++{
      calendar.set(Calendar.HOUR_OF_DAY, preTimings[i]);
      long timeInMillis = calendar.getTimeInMillis();
  
      newEvent.put(CalendarContract.Events.CALENDAR_ID, 1);
      newEvent.put(CalendarContract.Events.TITLE, preTitle[i]);
      newEvent.put(CalendarContract.Events.DTSTART, timeInMillis);                   
      newEvent.put(CalendarContract.Events.DTEND, timeInMillis + 60000);
      newEvent.put(CalendarContract.Events.RRULE, &quot;FREQ=WEEKLY;BYDAY=MO&quot;);
      newEvent.put(CalendarContract.Events.HAS_ALARM, true);
      newEvent.put(CalendarContract.Events.EVENT_TIMEZONE, &quot;GMT-05:30&quot;);
  
  </code></pre>
  <p>So this program is setting the 12 p.m and 6 p.m correctly on Mondays every week but for some reason it is setting the 9 a.m on Tuesdays every week.
  I don't know what is wrong over here. I even tried converting the timeInMillis in an online calculator to know what is the result, but they are correct.</p>