You can use this class which I use . You need to pass the Date to the constructor and
public static CustomDate getYrMonthDateFormateString(String datestring) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss",Locale.getDefault());
Date d = sdf.parse(datestring);
return new CustomDate(d);
}
public static class CustomDate {
final String dayOfTheWeek;
final String day;
final String monthString;
final String monthStringComplete;
final String monthNumber;
final String year;
final String time;
CustomDate(Date date) {
dayOfTheWeek = (String) DateFormat.format("EEE", date); // Thursday
day = (String) DateFormat.format("dd", date); // 20
monthString = (String) DateFormat.format("MMM", date); // Jun
monthStringComplete = (String) DateFormat.format("MMMM", date); // June
monthNumber = (String) DateFormat.format("MM", date); // 06
year = (String) DateFormat.format("yy", date); // 2013
time = ((String) DateFormat.format("h:mm a", date)).toLowerCase().replace(" ", ""); // 6:00 am
}
public String getDayOfTheWeek() {
return dayOfTheWeek;
}
public String getDay() {
return day;
}
public String getMonthString() {
return monthString;
}
public String getMonthNumber() {
return monthNumber;
}
public String getYear() {
return year;
}
public String getTime() {
return time;
}
public String getMonthStringComplete() {
return monthStringComplete;
}
}