static public Date parseDate(String s) throws ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
return format.parse(s);
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
return format.parse(s);
}
调试欢乐多
ParseException {
try {
Date date;
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
date = formatter.parse(s);
return date;
}
catch (ParseException e) {
throw e;
}
}
调用stringToDate("2002-08-09","yyyy-MM-dd")