Here you can find the source of getDateNextMonth(java.util.Date current)
static public java.util.Date getDateNextMonth(java.util.Date current)
//package com.java2s; import java.sql.*; import java.util.Calendar; public class Main { static public java.util.Date getDateNextMonth(java.util.Date current) { Calendar cal = Calendar.getInstance(); cal.setTime(current);/*w w w .ja va 2 s.c om*/ Date retVal = null; // Make sure it is not December if (cal.get(Calendar.MONTH) == Calendar.DECEMBER) { cal.set(Calendar.MONTH, Calendar.JANUARY); } else { cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) + 1); } retVal = new Date(cal.getTimeInMillis()); return retVal; } }