title: How can I change date from 24-hours format to 12-hours format (am/pm) in android
body: <pre><code>Calendar ci = Calendar.getInstance();
  
  CiDateTime = "" + (ci.get(Calendar.MONTH) + 1) +  
      "/" + ci.get(Calendar.DAY_OF_MONTH) + 
      "/" + ci.get(Calendar.YEAR);
  
  String visitdatetime = CiDateTime + "" + 
            ci.get(Calendar.HOUR_OF_DAY) + ":" + 
            ci.get(Calendar.MINUTE) + ":" + 
            ci.get(Calendar.SECOND);
  
  SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy  hh:mm  a");
  </code></pre>
  
  <p>I am getting from the server in 24 hours format.but want to show my date like MM/dd/yyyy hh:mm AM/PM like 12 hrs format.</p>