将 12 小时日期时间格式转换为 24 小时日期时间格式时,我无法解析日期。代码是
List_CallDateTime=rs.getString(5);
System.out.print(List_CallDateTime);
String str=List_CallDateTime;
SimpleDateFormat callreadFormat=new SimpleDateFormat("MM/dd/yyyy hh:mm aa",Locale.US);
SimpleDateFormat callwirteformat=new SimpleDateFormat("MMM dd yyyy HH:mm",Locale.US);
Date calldate=null;
calldate=callreadFormat.parse(str);
String callcreatedate=callwirteformat.format(calldate);
System.out.println("asdsad"+callcreatedate);
我得到的例外是
StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
java.text.ParseException: Unparseable date: "04/25/2012 9:00AM"