String dateFormatString = "yyyy/MM/dd HH:mm:ss";
SimpleDateFormat format = new SimpleDateFormat(dateFormatString);
format.setLenient(false);
try {
Date date = format.parse("2012/11/09 12:34:07");
//format = new SimpleDateFormat(dateFormatString, Locale.getDefault())
System.err.println(date.toLocaleString());
} catch (ParseException ex) {
Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
}报一下错误java.text.ParseException: Unparseable date: "yyyy/MM/dd HH:mm:ss"
at java.text.DateFormat.parse(DateFormat.java:337)
at com.vanch.sdk.Utility.isValiadDateString(Utility.java:102)
at com.vanch.test.NewClass.main(NewClass.java:40)
SimpleDateFormat format = new SimpleDateFormat(dateFormatString);
format.setLenient(false);
try {
Date date = format.parse("2012/11/09 12:34:07");
//format = new SimpleDateFormat(dateFormatString, Locale.getDefault())
System.err.println(date.toLocaleString());
} catch (ParseException ex) {
Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
}报一下错误java.text.ParseException: Unparseable date: "yyyy/MM/dd HH:mm:ss"
at java.text.DateFormat.parse(DateFormat.java:337)
at com.vanch.sdk.Utility.isValiadDateString(Utility.java:102)
at com.vanch.test.NewClass.main(NewClass.java:40)
不会有错的,你debug试试
怎么会有java.text.DateFormat.parse