title: Difference between hh:mm a and HH:mm a
body: <p>Here is my original code-</p>
  
  <pre><code>String dateString = "23 Dec 2015 1:4 PM";
  Locale locale = new Locale("en_US");
  SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm a");
  DateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm a", locale);
  Date date = null;
  
  try {
      date = formatter.parse(dateString);
  } catch (ParseException e) {
      LOGGER.error(e);
  }
  
  String newDate = df.format(date);
  System.out.println("oldDate = " + dateString);
  System.out.println("newDate = " + newDate);
  </code></pre>
  
  <p>and here is my output-</p>
  
  <pre><code>oldDate = 23 Dec 2015 1:4 PM
  newDate = 23 Dec 2015 01:04 AM
  </code></pre>
  
  <p>There is <strong>AM-PM difference</strong> between the <code>oldDate</code> and <code>newDate</code>. Now I changed the <code>DateFormat</code> code to-</p>
  
  <pre><code>SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy hh:mm a");
  DateFormat df = new SimpleDateFormat("dd MMM yyyy hh:mm a", locale);
  </code></pre>
  
  <p>and I get the expected output, which is-</p>
  
  <pre><code>oldDate = 23 Dec 2015 1:4 PM
  newDate = 23 Dec 2015 01:04 PM
  </code></pre>
  
  <p>I'm aware that <code>HH</code> signifies the <strong>24 hour</strong> format and <code>hh</code> signifies the <strong>12-hour</strong> format.</p>
  
  <p><strong>My question is</strong></p>
  
  <p>If I use <code>HH:mm a</code> instead of <code>hh:mm a</code>, shouldn't this be returning the time in <strong>24-hour</strong> format? </p>
  
  <p>(or)</p>
  
  <p>If it defaults to <strong>12-hour</strong> format, shouldn't it return respective AM/PM marker depending on the date input provided?</p>
  
  <p>This is just for my understanding.</p>