i hav String date & i want to inceament date by 1 & it should be loop until end of the month.
as examle, if i take November 2010 it should loop 30 days.
if i take December 2010 it should loop 31 days.
below shows my code……
String date="12/01/2010";
String incDate;
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
Calendar c = Calendar.getInstance();
c.setTime(sdf.parse(date));
for(int co=0; co<30; co++){
c.add(Calendar.DATE, 1);
incDate = sdf.format(c.getTime());
}
The
c.getActualMaximum(Calendar.DAY_OF_MONTH)result will be the last day of the month.