title: how to format date using SimpleDateFormat
body: <p>I cannot format a date.
   <code>dateFormat.format()</code> accepts a <code>Date</code> as argument. So I created a new <code>Date()</code></p>
  
  <p>It says the below Date() method is deprecated, and I get the below exception while running.</p>
  
  <p>exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException at
  java.util.Date.parse(Date.java:598)
  
  
  public class MyDate {
      public static void main(String[] args) {
  
  
          Date date = new Date("2012-02-16T00:00:00.000-0500");
  
          SimpleDateFormat dateFormat = new SimpleDateFormat(
                  "dd-MMM-yyyy HH:mm:ss");
          String stringDate = dateFormat.format(date);
  
          System.out.println(stringDate); // how do I test this conversion??
  
      }
  }
  </code></pre>
  
  <p>My database has date of the format - 2012-02-16T00:00:00.000-0500
  I need to convert it to string of the format : dd-MMM-yyyy HH:mm:ss</p>
  
  <p>I'm using Java6</p>