title: Changing one date format to another
body: <p>I 'm getting the date in the following format (<code>Date</code> and not <code>String</code>):</p>
  
  <pre><code>Tue Jun 26 07:00:00 EDT 2012
  </code></pre>
  
  <p>I want to change the format of the date to (Date):</p>
  
  <pre><code>6/26/2012 10:19:15 AM 
  </code></pre>
  
  <p>so as to update the same in the data base. I tried following code:</p>
  
  <pre><code>Date dte;
  Date dte1;(Tue Jun 26 07:00:00 EDT 2012)
  SimpleDateFormat formatter = new SimpleDateFormat("m/dd/yyyy hh:mm:ss a");
  String formattedDate = formatter.format(dte1);
  dte  = formatter.parse(formattedDate);
  SystemUtils.trace("test", " date&gt;&gt;&gt;" + dte); 
  </code></pre>
  
  <p>is yielding the following response:</p>
  
  <pre><code>Thu Jan 26 07:00:00 EST 2012
  </code></pre>
  
  <p>Can any one please share the piece of code to do the same asap.</p>