title: How to get Hours from a date using java
body: <p>What is the date format to get only hours in <code>12-hours</code> format from this time  </p>
  
  <pre><code> Thu Oct 20 13:12:00 GMT+02:00 2011
  </code></pre>
  
  <h2>edit:</h2>
  
  <p>using this code </p>
  
  <pre><code>Date eventDate = tempAppointments.get(i).mStartDate
  System.out.println(eventDate.toString());
  
  // date pattern
  DateFormat df = new SimpleDateFormat("hh:'00' a");//output : Wed Nov 09 11:00:00 GMT+02:00 2011
  
  
  // get the start date with new format (pattern) 
  String hours = df.format(tempAppointments.get(i).mStartDate.getDay());
  System.out.print(hours);//output: 02:00 AM
  </code></pre>
  
  <p>return hours as </p>
  
  <pre><code>02:00 AM
  </code></pre>
  
  <p>but for the given time. it must be <code>02:00 PM</code> . why ?</p>