Method to get the Date instance for the given days to be subtracted to the current date

@param noOfDays
@return the Date instance
@throws ParseException
547683
public static Date getDateWithPrevDays(int noOfDays) throws ParseException {
        Calendar currentDate = Calendar.getInstance();
        currentDate.add(Calendar.DATE, -noOfDays);
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZ);
        String dateNow = formatter.format(currentDate.getTime());
        return getDateFromString(dateNow);
    }
1021003
public static Date substractDaysFromDate(final Date date, final int substractDays)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.DATE, substractDays * -1);
		return dateOnCalendar.getTime();
	}
1132933
function getFutureDays(days) {
    var now = new Date();
    now.setTime(now.getTime() + (days * 24 * 60 * 60 * 1000));
    return now;
}
624224
public static Date dateIncreaseByDay(Date date, int days) {

        Calendar cal = GregorianCalendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, days);

        return cal.getTime();
    }
953728
public static Date toDateDayOfWeek(int dayOfWeek)
   {
	Calendar cal = Calendar.getInstance();
	cal.set(Calendar.DAY_OF_WEEK, dayOfWeek);
	
	return cal.getTime();
   }
989390
public static Function<Object,Date> date(final String methodName, final Object... optionalParameters) {
        return methodForDate(methodName, optionalParameters);
    }
439790
public static long getDaysBetweenIgnoreTime(Date startDate, Date endDate) {
        startDate = getRoundedDay(startDate);
        endDate = getNextDay(endDate);
        return getBetweenDate(startDate, endDate);
    }
1315595
private void getWeeklyDates(Calendar calendar, int frequency, List<Date> dates)
   {
      int currentDay = calendar.get(Calendar.DAY_OF_WEEK);

      while (moreDates(calendar, dates))
      {
         int offset = 0;
         for (int dayIndex = 0; dayIndex < 7; dayIndex++)
         {
            if (getWeeklyDay(Day.getInstance(currentDay)))
            {
               if (offset != 0)
               {
                  calendar.add(Calendar.DAY_OF_YEAR, offset);
                  offset = 0;
               }
               if (!moreDates(calendar, dates))
               {
                  break;
               }
               dates.add(calendar.getTime());
            }

            ++offset;
            ++currentDay;

            if (currentDay > 7)
            {
               currentDay = 1;
            }
         }

         if (frequency > 1)
         {
            offset += (7 * (frequency - 1));
         }
         calendar.add(Calendar.DAY_OF_YEAR, offset);
      }
   }
1169114
public static int getDayOfWeek(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.DAY_OF_WEEK);
    }
325034
@Override
	public double getDaycount(LocalDate startDate, LocalDate endDate) {
		if(startDate.isAfter(endDate)) {
			return -getDaycount(endDate,startDate);
		}

		return daysBetween(startDate, endDate);
	}
1153307
public static Date plus(Date self, int days) {
        Calendar calendar = (Calendar) Calendar.getInstance().clone();
        calendar.setTime(self);
        calendar.add(Calendar.DAY_OF_YEAR, days);
        return calendar.getTime();
    }
1276271
public static DayOfWeek plus(final DayOfWeek self, int days) {
        int daysPerWeek = DayOfWeek.values().length;
        int val = ((self.getValue() + days - 1) % daysPerWeek) + 1;
        return DayOfWeek.of(val > 0 ? val : daysPerWeek + val);
    }
1316230
public CalendarDays minus(CalendarDays other) {

        return CalendarDays.of(Math.subtractExact(this.days, other.days));

    }
1245334
public static final Parser<Date> instance() { // NOPMD it's thread save!
    if (DateParser.instanceParser == null) {
      synchronized (DateParser.class) {
        if (DateParser.instanceParser == null) {
          DateParser.instanceParser = new DateParser("yyyy-MM-dd");
        }
      }
    }
    return DateParser.instanceParser;
  }
851404
public D plus(CalendarDays days) {

        long result = Math.addExact(this.getDaysSinceEpochUTC(), days.getAmount());

        try {
            return this.getChronology().getCalendarSystem().transform(result);
        } catch (IllegalArgumentException iae) {
            ArithmeticException ex = new ArithmeticException("Out of range: " + result);
            ex.initCause(iae);
            throw ex;
        }

    }
439487
public Date parse(String dateString)
	throws ParseException
	{
		Date result = null;
		ParseException lastException = null;
		
		for (DateFormat format : inputFormats)
		{
			try
			{
				result = ((DateFormat) format.clone()).parse(dateString);	// DateFormat is not thread safe.
				lastException = null;
				break;
			}
			catch (ParseException e)
			{
				// Keep the first exception that occurred.
				if (lastException == null)
				{
					lastException = e;
				}
				// And just try the next input format.
			}
		}

		if (lastException != null)
		{
			throw lastException;
		}

		return result;
	}
418901
public PrettyTime withWeeksToDays() {

        if (this.weekToDays) {
            return this;
        }

        return new PrettyTime(
            this.locale,
            this.refClock,
            this.zeroDigit,
            this.minusSign,
            this.emptyUnit,
            true,
            this.shortStyle,
            this.stdListSeparator,
            this.endListSeparator);

    }