How to convert a string date “2019-04-21T12:08:35” to SimpleDateFormat, there by convert to Date?

前端 未结 2 1250
甜味超标
甜味超标 2021-01-29 12:35

For normal date Strings like \"2019-04-08 08:35\"

   SimpleDateFormat df = new SimpleDateFormat(\"yyyy-dd-mm hh:mm\");

but What sh

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 13:17

    Before Java8 :

    SimpleDateFormat df = new SimpleDateFormat("yyyy-dd-yy'T'hh:mm:ss");
    

提交回复
热议问题