title: Parsing Date that is read from file
body: <p>I have record in the file as <code>17 Dec 2010 17:02:24 17 Dec 2010 18:02:24</code>. I am reading these from file....
  my parser code is:</p>
  
  <pre><code>static SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy hh:mm:ss");
  
  public static String DateFormat(String startdate) {
  
      String date = null;
      try {
  
          java.util.Date tDate = df.parse(startdate);
  
          df = new SimpleDateFormat("dd-MMM-yy hh:mm:ss a");
          String formatteddate = df.format(tDate).toUpperCase();
  
          return formatteddate;
  
      } catch (ParseException e) {
          System.out.println("Unable to Parse" + e);
      }
      return date;
  
  }
  </code></pre>
  
  <p>but only first date format get parsed...then error will be <em>unable to parse</em></p>