How can I format a LocalDate
instance to the tune of 18th Aug, 2013
using Joda Time Date formatter?
LocalDate localDate = new LocalDate();
string = localDate.toString(dateformat); //what to put in here?
How can I format a LocalDate
instance to the tune of 18th Aug, 2013
using Joda Time Date formatter?
LocalDate localDate = new LocalDate();
string = localDate.toString(dateformat); //what to put in here?
The closest you will get is
String dateString = localDate.toString("dd MMM yyyy");
i.e. the date affix ("th" in this case) is not supported
LocalDate localDate = new LocalDate();
DateTimeFormatter fmt = DateTimeFormat.forPattern("ddd MMMM, yyyy");
string = localDate.toString();
More information about Joda Time formatting you can find at http://www.joda.org/joda-time/key_format.html. there's also explained how to use Builder to make custom date patterns.
Good luck