I am getting date in form of "20150119" and I want to convert it into the format like: "19. January 2015" .
How can I convert date in such format.
I tried below code:
private void convertDate() {
String m_date = "20150119";
SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy.MM.dd");
try {
Date date = originalFormat.parse(m_date.toString());
Log.e("Date is====", date.toLocaleString());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
But its giving me error:
java.text.ParseException: Unparseable date: "20150119" (at offset 8)