"Thur" isn't a valid value for the day name in week, a three-letter representation is expected. So I would suggest to normalize that before parsing the date, e.g. by just replacing "thur" with "thu".
java date format 26Mar2009(thur) error
-
15-07-2023 - |
题
DateFormat format = new SimpleDateFormat("ddMMMyyyy(E)",Locale.ENGLISH);
try {
Date date = format.parse("26Mar2009(thur)");
System.out.println(date.getDate());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
the error is :java.text.ParseException: Unparseable date: "26Mar2009(thur)" but it can parse "26Mar2009(thu)", so i want to know how to parse "26Mar2009(thur)"?
解决方案
不隶属于 StackOverflow