title: How to get Timestamp with AM/PM in java
body: <p>I have a date as String , which needs to be converted in to Time Stamp with AM/PM . I tried the below way, I'm getting the proper date format but didn't get in AM/PM. <br/></p>
  
  <p>Can any one please help ?<br/></p>
  
  <p>code Snippet:</p>
  
  <pre><code>String dateString = "10/10/2010 11:23:29 AM";
  
  SimpleDateFormat sfdate = new SimpleDateFormat("MM/dd/yyy HH:mm:ss a");
      Date date = new Date();
      date = sfdate.parse(dateString);
      System.out.println(new Timestamp(date.getTime()));
  </code></pre>
  
  <p>Which gives me the output as below :<br/></p>
  
  <pre><code>2010-10-10 11:23:29.0
  </code></pre>
  
  <p>But I needs it like this <br/></p>
  
  <pre><code>2010-10-10 11:23:29.00000000 AM
  </code></pre>
  
  <p>Kindly help me please.</p>