Here you can find the source of getFormatDateAdd(Date date, int amount, String format)
public static String getFormatDateAdd(Date date, int amount, String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static String getFormatDateAdd(Date date, int amount, String format) {/*from ww w . j av a 2 s. c om*/ Calendar cal = new GregorianCalendar(); cal.setTime(date); cal.add(GregorianCalendar.DATE, amount); return getFormatDateTime(cal.getTime(), format); } public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }