I want to display date in month and date format(ex:May 26).But when I am trying to use it was showing cannot resolve method.
String dateStr = DateFormat.format("MMM dd", cal.getTime().getTime()).toString();
You can use SimpleDateFormat
.
SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd", Locale.US);
Date date = new Date(cal.getTimeInMillis());
String dateStr = dateFormat.format(date);