Parse any date in Java

后端 未结 6 691
时光取名叫无心
时光取名叫无心 2020-11-22 07:31

I know this question is asked quite a bit, and obviously you can\'t parse any arbitrary date. However, I find that the python-dateutil library is able to parse every date I

6条回答
  •  囚心锁ツ
    2020-11-22 08:04

    //download library:   org.ocpsoft.prettytime.nlp.PrettyTimeParser
    String str = "2020.03.03";
    Date date = new PrettyTimeParser().parseSyntax(str).get(0).getDates().get(0);
    System.out.println(date)
    

提交回复
热议问题