Get the number of years from this date to the given day.

@param end The end date.
@return The number of years from this date to the given day.
338264
long yearsUntil(PaxDate end) {
        // If either date is after the inserted leap month, and the other year isn't leap, simulate the effect of the inserted month.
        long startYear = getProlepticYear() * 512L + getDayOfYear() + (this.month == MONTHS_IN_YEAR && !this.isLeapYear() && end.isLeapYear() ? DAYS_IN_WEEK : 0);
        long endYear = end.getProlepticYear() * 512L + end.getDayOfYear() + (end.month == MONTHS_IN_YEAR && !end.isLeapYear() && this.isLeapYear() ? DAYS_IN_WEEK : 0);
        return (endYear - startYear) / 512L;
    }
325034
@Override
	public double getDaycount(LocalDate startDate, LocalDate endDate) {
		if(startDate.isAfter(endDate)) {
			return -getDaycount(endDate,startDate);
		}

		return daysBetween(startDate, endDate);
	}
1115329
public NumberExpression<Integer> year() {
        if (year == null) {
            year = Expressions.numberOperation(Integer.class, Ops.DateTimeOps.YEAR, mixin);
        }
        return year;
    }
489386
private long yearToDayOfEpoch(long year)
  {
    if (year > 0) {
      year -= 1601;
      return (365 * year + year / 4 - year / 100 + year / 400 -
              ((1970 - 1601) * 365 + (1970 - 1601) / 4 - 3));
    } else {
      year = 2000 - year;

      return ((2000 - 1970) * 365 + (2000 - 1970) / 4 -
              (365 * year + year / 4 - year / 100 + year / 400));
    }
  }
515126
public Integer getEnd() {
    if (mtasPositionType.equals(POSITION_RANGE)
        || mtasPositionType.equals(POSITION_SET)) {
      return mtasPositionEnd;
    } else if (mtasPositionType.equals(POSITION_SINGLE)) {
      return mtasPositionStart;
    } else {
      return null;
    }
  }
1189933
public static int weekCount(Date start, Date end) {
		final Calendar startCalendar = Calendar.getInstance();
		startCalendar.setTime(start);
		final Calendar endCalendar = Calendar.getInstance();
		endCalendar.setTime(end);

		final int startWeekofYear = startCalendar.get(Calendar.WEEK_OF_YEAR);
		final int endWeekofYear = endCalendar.get(Calendar.WEEK_OF_YEAR);

		int count = endWeekofYear - startWeekofYear + 1;

		if (Calendar.SUNDAY != startCalendar.get(Calendar.DAY_OF_WEEK)) {
			count--;
		}

		return count;
	}
36776
public function endOfDecade()
    {
        $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1;

        return $this->setDate($year, 12, 31)->endOfDay();
    }
27206
public LocalDateTime getEndDateTime() {
        if (endDateTime == null) {
            endDateTime = LocalDateTime.of(getEndDate(), getEndTime());
        }

        return endDateTime;
    }
1074255
public static Date getDateOfYearsBack(final int yearsBack, final Date date) {

    return dateBack(Calendar.YEAR, yearsBack, date);
  }
957267
@SuppressWarnings("deprecation")
    protected Date getEndDate(Query query) {
        Instant instant = query.getInstantFilter("Ending");
        if (instant == null)
            return null;
        else {
            Date end = new Date(Date.from(instant).getTime() + DatabaseAccess.getDbTimeDiff());
            if (end.getHours() == 0) {
                end = new Date(end.getTime() + DAY_MS);  // end of day
            }
            return end;
        }
    }
615232
public static int days(EvaluationContext ctx, Object endDate, Object startDate) {
        return datedif(ctx, startDate, endDate, "d");
    }
253410
public int lengthOfYear() {

        int c = this.cycle;
        int y = this.yearOfCycle;
        y++;

        if (y > 60) {
            y = 1;
            c++;
        }

        long ny1 = this.getCalendarSystem().newYear(this.cycle, this.yearOfCycle);
        long ny2 = this.getCalendarSystem().newYear(c, y);
        return (int) (ny2 - ny1);

    }
1304673
private T getOpenFiniteEnd() {

        T temporal = this.end.getTemporal();

        if ((temporal != null) && this.end.isClosed()) {
            return this.getTimeLine().stepForward(temporal);
        } else {
            return temporal;
        }

    }
512799
public static function years(int $start = 1980, int $end = 2024) : array
    {
        return Date::_range(1, $start, $end, true);
    }
321724
@Override
	public double getDaycount(LocalDate startDate, LocalDate endDate) {
		if(startDate.isAfter(endDate)) {
			return -getDaycount(endDate,startDate);
		}

		int startDateDay 	= startDate.getDayOfMonth();
		int startDateMonth 	= startDate.getMonthValue();
		int startDateYear 	= startDate.getYear();

		int endDateDay 		= endDate.getDayOfMonth();
		int endDateMonth 	= endDate.getMonthValue();
		int endDateYear 	= endDate.getYear();


		// Check if we have last day of February
		boolean isStartDateLastDayOfFebruary = (startDateMonth == Month.FEBRUARY.getValue() && startDateDay == startDate.lengthOfMonth());
		boolean isEndDateLastDayOfFebruary = (endDateMonth == Month.FEBRUARY.getValue() && endDateDay == endDate.lengthOfMonth());

		// Last day of February and 31st of a month are both treated as "30".
		if(isStartDateLastDayOfFebruary || startDateDay == 31) {
			startDateDay = 30;
		}
		if((isEndDateLastDayOfFebruary && !isTreatEndDateAsTerminationDate) || endDateDay == 31) {
			endDateDay = 30;
		}

		return (endDateYear - startDateYear) * 360.0 + (endDateMonth - startDateMonth) * 30.0 + (endDateDay - Math.min(startDateDay, 30.0));
	}
1042258
def from_years_range(start_year, end_year):
        """"""
        start = datetime.date(start_year, 1 , 1)
        end = datetime.date(end_year, 12 , 31)
        return DateRange(start, end)
507995
public static long getTwoDaysBetweenNumber(String startDate, String endDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        long day = 0;
        try {
            java.util.Date startDay = localFormat.parse(startDate);
            java.util.Date endDay = localFormat.parse(endDate);
            day = (endDay.getTime() - startDay.getTime()) / (24 * 60 * 60 * 1000);
        } catch (Exception e) {
            return 0;
        }
        return day;
    }