date format in java
<p>My requirement is to get the date in format <code>MM/dd/yy</code>. But I am currently getting the date value as "Sun Dec 31 00:00:00 IST 2006". I tried a sample code for the conversion as follows.</p>

<pre><code>String pattern = "MM/dd/yyyy";
  SimpleDateFormat format = new SimpleDateFormat(pattern);
  try {
    Date date = format.parse("12/31/2006");
    System.out.println(date);
  } catch (ParseException e) {
    e.printStackTrace();
  }
</code></pre>

<p>Please help me to convert the given date into <code>MM/dd/yy</code></p>
