使用DateLocaleConverter:
- public static void change() {
- String birthday = "1990-12-32";
- DateLocaleConverter conv = new DateLocaleConverter();
- System.out.println(conv);
- conv.convert(birthday,"yyyy-MM-dd");
- }
使用SimpleDateFormat:
- String birthday = "1990-12-32";
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
- Date date =sdf.parse(birthday);
区别:待更新