public static Date stringToDate(String s,DateFormat formatter){
  try {
    return formatter.parse(s);
  }
 catch (  ParseException e) {
    return null;
  }
}

public static Date stringToDate ( String s , DateFormat formatter ) { try { return formatter . parse ( s ) ; } catch ( ParseException e ) { return null ; } }
convert a date time string ( e . g . , " 2011 - 06 - 07 19 : 12 : 18 " ) to a date object .
