title: Rounding calendar time to nearest 5 mins
body: <p>The code below works well for rounding java calendar time to the nearest 15mins, however how can I change the code below to allow for rounding to the closest 5mins clock mark.</p>
  
  <p>Code:</p>
  
  <pre><code>int unroundedMinutes = isha_jamaat_cal.get(Calendar.MINUTE);
  int mod = unroundedMinutes % 15;
  System.out.println("#######mod: " + mod);
  isha_jamaat_cal.add(Calendar.MINUTE, mod &lt; 8 ? -mod : (15-mod));
  </code></pre>