title: How to set correct time with AM PM with Calendar object?
body: <p>Simple question why the result is like the following for this code:</p>
  <pre class="lang-java prettyprint-override"><code>Calendar cal2 = Calendar.getInstance();
  cal2.set(Calendar.HOUR, 12);
  cal2.set(Calendar.AM_PM, Calendar.PM);
  System.out.println(cal2.getTime().toString()); // Wed Jan 13 00:11:08 EET 2021
  cal2.set(Calendar.AM_PM, Calendar.PM);
  System.out.println(cal2.getTime().toString()); // Wed Jan 13 12:11:08 EET 2021
          
  Calendar cal = Calendar.getInstance();
  cal.set(Calendar.HOUR, 12);
  cal.set(Calendar.AM_PM, Calendar.AM);
  System.out.println(cal.getTime().toString()); // Tue Jan 12 12:11:08 EET 2021
  cal.set(Calendar.AM_PM, Calendar.AM);
  System.out.println(cal.getTime().toString()); // Tue Jan 12 00:11:08 EET 2021
  </code></pre>
  <p>The first looks like it is 12 at midnight not afternoon.
  The third one looks like it is 12 afternoon, not midnight</p>
  <p>Why setting calendar AM or PM multiple times change the result?
  How to set the time correctly?</p>