Subtract years from the date and then adjust to the beginning of the
resultant year.

@param date input date
@param years years to add
@return new date
174841
protected final LocalDate minusYearsAdjustToBegin(final LocalDate date,
            final int years) {
        final LocalDate adjustedYears = minusYears(date, years);
        final LocalDate firstMonth = firstMonth(adjustedYears);
        return firstDayOfMonth(firstMonth);
    }
991198
public static int getDayOfYear(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.DAY_OF_YEAR);
    }
937778
public void setYear(int year){
        if(mAdapter.getYear() == year)
            return;

        mAdapter.setYear(year);
        goTo(year);
    }
175523
public long add(long instant, int years) {
        if (years == 0) {
            return instant;
        }
        return set(instant, get(instant) + years);
    }
215176
@Override
    public Temporal addTo(Temporal temporal) {
        validateChrono(temporal);
        if (months == 0) {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
        } else {
            long monthRange = monthRange();
            if (monthRange > 0) {
                temporal = temporal.plus(years * monthRange + months, MONTHS);
            } else {
                if (years != 0) {
                    temporal = temporal.plus(years, YEARS);
                }
                temporal = temporal.plus(months, MONTHS);
            }
        }
        if (days != 0) {
            temporal = temporal.plus(days, DAYS);
        }
        return temporal;
    }
1032446
public void setYearlyAbsoluteFromDate(Date date)
   {
      if (date != null)
      {
         Calendar cal = DateHelper.popCalendar(date);
         m_dayNumber = Integer.valueOf(cal.get(Calendar.DAY_OF_MONTH));
         m_monthNumber = Integer.valueOf(cal.get(Calendar.MONTH) + 1);
         DateHelper.pushCalendar(cal);
      }
   }
250771
public final void showYear(Year year) {
        requireNonNull(year);
        if (!yearPage.isHidden()) {
            selectedPage.set(getYearPage());
            setDate(year.atDay(1));
        }
    }
1271996
public static Date addYears(Date date, int amount) {
        return org.apache.commons.lang.time.DateUtils.addYears(date, amount);
    }
237806
public CalendarMonth minus(Years<CalendarUnit> years) {

        if (years.isEmpty()) {
            return this;
        }

        return CalendarMonth.of(MathUtils.safeSubtract(this.year, years.getAmount()), this.month);

    }
1116547
public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
505502
static public Date adjustDate(Date date)
  {
    long milliToAdjust = ResultUtil.msDiffJulianToGregorian(date);

    if (milliToAdjust != 0)
    {
      // add the difference to the new date
      return new Date(date.getTime() + milliToAdjust);
    }
    else
    {
      return date;
    }
  }
1173753
public CalendarMonth plus(Years<CalendarUnit> years) {

        if (years.isEmpty()) {
            return this;
        }

        return CalendarMonth.of(MathUtils.safeAdd(this.year, years.getAmount()), this.month);

    }
625398
public function plusYears(int $years) : YearWeek
    {
        if ($years === 0) {
            return $this;
        }

        return $this->withYear($this->year + $years);
    }
463018
public static long betweenYear(Date beginDate, Date endDate, boolean isReset) {
		return new DateBetween(beginDate, endDate).betweenYear(isReset);
	}
1150052
public static Date dateReservedYear(int year, boolean is000) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, year);

        return is000 ? dateReservedYear000(calendar) : dateReservedYear999(calendar);
    }
1001027
public static PeriodType years() {
        PeriodType type = cYears;
        if (type == null) {
            type = new PeriodType(
                "Years",
                new DurationFieldType[] { DurationFieldType.years() },
                new int[] { 0, -1, -1, -1, -1, -1, -1, -1, }
            );
            cYears = type;
        }
        return type;
    }
1003846
public function withYears(int $years) : Period
    {
        if ($years === $this->years) {
            return $this;
        }

        return new Period($years, $this->months, $this->days);
    }