Joda time : How to convert String to LocalDate?

前端 未结 6 1228
旧巷少年郎
旧巷少年郎 2020-12-05 17:05

How to specify the format string to convert the date alone from string. In my case, only the date part is relevant

Constructing it as DateTime fails:

6条回答
  •  旧巷少年郎
    2020-12-05 17:37

    This worked for me:

    LocalDate d1 = LocalDate.parse("2014-07-19");
    LocalDate dNow = LocalDate.now();  // Current date
    

提交回复
热议问题