How to convert calendar date to yyyy-MM-dd format.
yyyy-MM-dd
Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 1); Date date = cal.getTime();
java.util.Date object can't represent date in custom format instead you've to use SimpleDateFormat.format method that returns string.
java.util.Date
SimpleDateFormat.format
string
String myString=format1.format(date);