incorrect conversion of String into date format

前端 未结 3 1396
一整个雨季
一整个雨季 2021-01-26 11:56

I am trying to format a string into specific date format but there is some problem in conversion. In converted string month is always coming \"January\". Following is the code s

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-26 12:41

    Use MM instead of mm for the date portion of your format string. mm is for minutes, not months.

    Reference: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html

提交回复
热议问题