Android : How to display date in exact format with month and year format

on Friday, October 24, 2014


Hi how to display given string with July 3, 1969 for string 1969-07-03



String a="1969-07-1969;


Expected output: July 3, 1969


I used this method initially to convert in right format.



textView.setText(reverseIt(a)); // but this reverse the whole string.

public static String reverseIt(String source) {
int i, len = source.length();
StringBuffer dest = new StringBuffer(len);

for (i = (len - 1); i >= 0; i--)
dest.append(source.charAt(i));
return dest.toString();
}


Please help me to solve this.


0 comments:

Post a Comment