Java date format

前端 未结 5 1369
余生分开走
余生分开走 2021-01-16 01:41

Have String str \"May 23 2011 12:20:00\", want to convert it to date such this:

Date date = (new SimpleDateFormat(\"MMM dd yyyy HH:mm:ss\")).parse(str);
         


        
5条回答
  •  情深已故
    2021-01-16 02:24

    Probably It's a problem with a tool you use. Take a look at:

    Why am I getting a ParseException when using SimpleDateFormat to format a date and then parse it?

提交回复
热议问题