title: Date Format JAVA
body: <p>I want to format <code>2012-05-04 00:00:00.0</code> to <code>04-MAY-2012</code>. i have tried it with below steps.</p>
  
  <pre><code>    SimpleDateFormat sdf = new SimpleDateFormat(
              "yyyy-MM-dd 'T' HH:mm:ss.SSS");
  
      Date date;
      String dateformat = "";
      try {
          date = sdf.parse("2012-05-04 00:00:00.0");
          sdf.applyPattern("DD-MON-RR");
          dateformat = sdf.format(date);
      } catch (ParseException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>but i got below exception. </p>
  
  <pre><code>java.text.ParseException: Unparseable date: "2012-05-04 00:00:00.0"
      at java.text.DateFormat.parse(DateFormat.java:337)
      at com.am.test.Commit.main(Example.java:33)`
  </code></pre>
  
  <p>How could i do this?</p>