How to convert String date to Date?

后端 未结 3 1858
北恋
北恋 2021-01-29 10:02

I have done following code:

String str = \"2013-01-17 11:26\";
DateFormat dateFormat = new SimpleDateFormat(\"yyyy-mm-dd hh:MM\");
Date date = dateFormat.parse(s         


        
3条回答
  •  生来不讨喜
    2021-01-29 10:44

    Just Using of DateFormat Class:

    ateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
    

提交回复
热议问题