Here you can find the source of getDateBeforeOrAfter(int iDate)
public static Date getDateBeforeOrAfter(int iDate)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getDateBeforeOrAfter(int iDate) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_MONTH, iDate); return cal.getTime(); }/*from w w w .j av a2 s. c o m*/ public static Date getDateBeforeOrAfter(Date curDate, int iDate) { Calendar cal = Calendar.getInstance(); cal.setTime(curDate); cal.add(Calendar.DAY_OF_MONTH, iDate); return cal.getTime(); } }