title: Date convert dd-MMM-yyyy to dd-MM-yyyy in java
body: <p>What is the simplest way to convert 23-Mar-2011 to 23-03-2011 in Java?</p>
  
  <hr>
  
  <p>Thanks everyone. This seem to solve the issue:</p>
  
  <pre><code>try { 
  Calendar cal = Calendar.getInstance(); 
  cal.setTime(new SimpleDateFormat("dd-MMM-yyyy").parse("24-Nov-2002")); 
  SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
  System.out.println(sdf.format(cal.getTime())); 
  } catch (ParseException e) { e.printStackTrace(); }
  </code></pre>