使用DateLocaleConverter:   

 

public static void change() {
    String birthday = "1990-12-32";
    DateLocaleConverter conv = new DateLocaleConverter();
    conv.convert(birthday,"yyyy-MM-dd");
}

 

  使用SimpleDateFormat:

 

String birthday = "1990-12-32";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(birthday);

 

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-01-18
  • 2021-06-12
  • 2022-12-23
  • 2022-02-08
  • 2022-01-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-07-18
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案