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();
In order to parse a java.util.Date object you have to convert it to String first using your own format.
java.util.Date
inActiveDate = format1.parse( format1.format(date) );
But I believe you are being redundant here.