Wrote Below Code in Android Java File to fetch Only Date which m getting but issue is not getting correct Month in my given format.
First m fetching current month as Bill Date. Second m fetching Current month + 1 as Due Date.
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-mm-yyyy");
Calendar cal = Calendar.getInstance();
String billdate= dateFormat.format(cal.getTime()).toString();
cal.add(Calendar.MONTH,1);
String duedate= dateFormat.format(cal.getTime()).toString();
Output:
22-42-2018 22-42-2018
Can't identify month. Anyone please resolve the query why m not getting exact month and what changes should i make.