title: How to convert string to time in android?
body: <p>I am getting string from voice(Speech to text). When i speak time it's display e.g. <strong>"530pm"</strong>. I want to convert only time from string. e.g. <strong>"530pm"</strong> to <strong>05:30 PM</strong>. How can i achieve this?
  Thanks in advance.</p>
  
  <p>I try this code but not work</p>
  
  <pre><code>String s= "530 pm";
          SimpleDateFormat dateFormat = new SimpleDateFormat("hh:mm aa"); 
          try {
              Date date1 = dateFormat.parse(s);
              Log.e("Time", ""+date1);
          } catch (ParseException e) {
              // TODO Auto-generated catch block
              Log.e("Error", ""+e);
          }
  </code></pre>