Parsing a date in Java?

前端 未结 7 1578
清酒与你
清酒与你 2020-12-04 03:15

I have dates in text format of the form dd-mmm-yy or d-mmm-y, where months are abbreviations in letters (for example, 4-Nov-09 or 12-Dec-05, etc...) I would like to parse it

7条回答
  •  一向
    一向 (楼主)
    2020-12-04 03:35

    You may need to use the SimpleDateFormat for parsing custom formats. This article explains the details of formatting.

    "d-MMM-yyyy" corresponds to 4-Nov-2009
    

提交回复
热议问题