Converting 24-hour clock time to am/pm in Joda-Time

前端 未结 1 1450
[愿得一人]
[愿得一人] 2021-01-12 01:26

I just started working with Joda-Time, and got it to correctly display my date in 24-hour clock (\"military time\") but I would rather it be am/pm. Looked it up and it ment

相关标签:
1条回答
  • 2021-01-12 01:54

    Look at the API documentation of DateTimeFormat. This should do what you want:

    DateTimeFormatter builder = DateTimeFormat.forPattern("dd-MM-yyyy hh:mm:ss.SSa");
    

    No need for the complication with different cases.

    0 讨论(0)
提交回复
热议问题