Java Date add Month
import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] argv) { Date startDate = new Date(); int addnos = 42; System.out.println(addMonth(startDate, addnos)); }// ww w . ja v a2 s .c o m public static Date addMonth(Date startDate, int addnos) { Calendar cc = Calendar.getInstance(); if (startDate != null) { cc.setTime(startDate); cc.add(Calendar.MONTH, addnos); return cc.getTime(); } else { return null; } } }