public static Date daysBefore(Date dateInst,int numDays){
  if ((numDays <= 0) || (dateInst == null)) {
    throw new IllegalArgumentException();
  }
  final Calendar cal=new GregorianCalendar();
  cal.setTime(dateInst);
  cal.add(Calendar.DAY_OF_YEAR,-numDays);
  return cal.getTime();
}

public static Date daysBefore ( Date dateInst , int numDays ) { if ( ( numDays <= 0 ) || ( dateInst == null ) ) { throw new IllegalArgumentException ( ) ; } final Calendar cal = new GregorianCalendar ( ) ; cal . setTime ( dateInst ) ; cal . add ( Calendar . DAY_OF_YEAR , - numDays ) ; return cal . getTime ( ) ; }
method to return a date instance which is exactly numdays days before the point in time designated by the input date .
