Here you can find the source of addDate(Date date, int add)
public static String addDate(Date date, int add)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String addDate(Date date, int add) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from w w w .j a v a 2 s .c om*/ calendar.add(Calendar.MONTH, add); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); return formatter.format(calendar.getTime()); } }