Here you can find the source of getNextMonth(Date time)
public static Date getNextMonth(Date time)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getNextMonth(Date time) { Calendar calendar = Calendar.getInstance(); if (null != time) { calendar.setTimeInMillis(time.getTime()); }//from w w w .jav a 2 s . c o m calendar.add(Calendar.MONTH, 1); return new Date(calendar.getTimeInMillis()); } public static Date getNextMonth(Date time, int after) { Calendar calendar = Calendar.getInstance(); if (null != time) { calendar.setTimeInMillis(time.getTime()); } calendar.add(Calendar.MONTH, after); return new Date(calendar.getTimeInMillis()); } }