Here you can find the source of getDateDiff(Date date, int day)
public static Date getDateDiff(Date date, int day)
//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 getDateDiff(Date date, int day) { cal.setTime(date);//from w w w . j av a 2 s. co m cal.add(Calendar.DAY_OF_MONTH, day); Date tmpdate = new Date(cal.getTime().getTime()); return tmpdate; } }