Teguh Teguh - 11 months ago 52
Java Question

get day name from string date using jodatime

I have string date like this

String s = "29-08-2016";

Desired result is the name of the day of the week:


How to resolve that?

Answer Source

Easy takeaway in Joda

String date = "29-08-2016";
LocalDate localDate = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(date);

prints : Monday