Here you can find the source of getDateAddMonth(java.sql.Date date, int months)
public static Date getDateAddMonth(java.sql.Date date, int months)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public final static Calendar cal = Calendar.getInstance(); public static Date getDateAddMonth(java.sql.Date date, int months) { if (date == null) { return null; }// ww w. j av a 2 s.c o m cal.setTime(new java.util.Date(date.getTime())); int month = cal.get(java.util.Calendar.MONTH); cal.set(java.util.Calendar.MONTH, month + months); return new java.sql.Date(cal.getTime().getTime()); } }