Date Parsing from one format to another format

后端 未结 2 449
[愿得一人]
[愿得一人] 2021-01-25 08:22

I want to change date format yyyy-mm-dd hh:mm:ss.SSS ( which is stored in database in string format) to mm/dd/yyyy for their comparison

while(rs.next()) 
           


        
2条回答
  •  孤街浪徒
    2021-01-25 08:52

    You have set myDateFormat1 to "yyyy-mm-dd hh:mm:ss.SSSSSS". I think the first mm should be in uppercase.

    I recommend you check your format strings with the documentation if SimpleDateFormat.

提交回复
热议问题