SimpleDateFormat 24h

前端 未结 1 1157
渐次进展
渐次进展 2021-02-02 07:26

I\'ve got a SimpleDateFormat to parse a String into a Date:

SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\'T         


        
相关标签:
1条回答
  • 2021-02-02 08:20

    Use HH instead of hh for the hours pattern:

    H   Hour in day (0-23)  Number  0
    k   Hour in day (1-24)  Number  24
    K   Hour in am/pm (0-11)    Number  0
    h   Hour in am/pm (1-12)    Number  12
    
    0 讨论(0)
提交回复
热议问题