Teguh Teguh - 1 year ago 117
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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download