title: java.util.Date format conversion yyyy-mm-dd to mm-dd-yyyy
body: <p>I have a <code>java.util.Date</code> in the format <code>yyyy-mm-dd</code>. I want it to be in the format <code>mm-dd-yyyy</code></p>
  <p>Below is the sample util I tried out for this conversion:</p>
  <pre><code>// Setting the pattern
  SimpleDateFormat sm = new SimpleDateFormat(&quot;mm-dd-yyyy&quot;);
  // myDate is the java.util.Date in yyyy-mm-dd format
  // Converting it into String using formatter
  String strDate = sm.format(myDate);
  //Converting the String back to java.util.Date
  Date dt = sm.parse(strDate);
  </code></pre>
  <p>Still the output I am getting is not in the format <code>mm-dd-yyyy</code>.</p>
  <p>Kindly let me know how to format a <code>java.util.Date</code> from <code>yyyy-mm-dd</code> to <code>mm-dd-yyyy</code></p>