Get number of years.

$years = Date::years();

@param  int $long  Start value
@param  int $start End value
@return array
512799
public static function years(int $start = 1980, int $end = 2024) : array
    {
        return Date::_range(1, $start, $end, true);
    }
631182
public function historyActivity($start = null, $end = null)
    {
        $url = $this->_baseURL . "/historyrecord";
        $flag = "?";
        if (!empty($start)) {
            $url = $url . $flag . "start=" . $start;
            $flag = "&";
        }
        if (!empty($end)) {
            $url = $url . $flag . "end=" . $end;
        }
        return $this->_transport->send(HttpRequest::GET, $url);
    }
320789
private static int getYear(CSLDate date, CSLDateParser dateParser) {
		if (date == null) {
			return -1;
		}
		if (date.getDateParts() == null ||
				date.getDateParts().length == 0 ||
				date.getDateParts()[0] == null ||
				date.getDateParts()[0].length == 0) {
			if (date.getRaw() != null && !date.getRaw().isEmpty()) {
				CSLDate d = dateParser.parse(date.getRaw());
				return getYear(d, dateParser);
			}
			return -1;
		}
		return date.getDateParts()[0][0];
	}
906186
public function select_year( $name, $begin, $end, $selected = null, $options = [] ) {
		return $this->select_range( ...func_get_args() );
	}
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)
1301442
public function getYears()
  {
    $years = array();

    foreach (range(date('Y'), 1950) as $x)
    {
      $years = array_add($years, $x, $x);
    }

    return $years;
  }
1141360
public static function getRangeMem( $start, $end, $dec = 2 )
	{
		if( !isset( self::$mem['mem'][$end] ) ){
			self::$mem['mem'][$end] = memory_get_usage();
		}
		$size = self::$mem['mem'][$end] - self::$mem['mem'][$start];
		$a    = ['B', 'KB', 'MB', 'GB', 'TB'];
		$pos  = 0;
		while( $size >= 1024 ){
			$size /= 1024;
			$pos ++;
		}
		return round( $size, $dec )." ".$a[$pos];
	}
624762
public static function schoolYear() {
		if (!static::$arrSchoolYearLoaded) {
			static::$arrSchoolYear = \Database::getInstance()->query("SELECT * FROM tl_schoolyear")->fetchAllAssoc();
			static::$arrSchoolYearLoaded = true;
		}
		foreach (static::$arrSchoolYear as $arrRow) {
			if($arrRow['start'] < time() && $arrRow['end'] > time()) {
				return date('Y',$arrRow['end']);
			}
		}
		return false;
	}
1250470
public function year()
    {
        if (!isset($this->year)) {
            $this->year = new Year($this->startDateTime->format('Y'));
        }
        return $this->year;
    }
855621
public static function getYearsAgo($ago, $endDateTime = null)
    {
        return static::getDateTimeRange(
            Carbon::now()->subYears($ago)->startOfYear(),
            $endDateTime ?: Carbon::now()->subYears($ago)->endOfYear()
        );
    }
1236106
public function getRangeUrls($start,$end){

        $urls = Array();

        if($end > $this->totalPages){
            $end = $this->totalPages;
        }//if

        if($start < 1){
            $start = 1;
        }//if

        for($i = $start; $i <= $end; $i++){
            $urls[] = $this->getPageUrl($i);
        }//for

        return $urls;
       
    }
791261
public static function isBetween($value, $start, $end)
    {
        if (is_array($start)) {
            $end = $start[1];
            $start = $start[0];
        }

        if ($value > $end || $value < $start) {
            return false;
        } else {
            return true;
        }
    }
736487
protected function yearSort($a, $b)
    {
        $aDates = $this->extractNewestDates($a);
        $bDates = $this->extractNewestDates($b);

        if (count($aDates) > 0 && count($bDates) > 0) {
            return $bDates[0] - $aDates[0];
        } elseif (count($aDates) > 0 && count($bDates) === 0) {
            return -1;
        } elseif (count($aDates) === 0 && count($bDates) > 0) {
            return 1;
        } else {
            return 0;
        }
    }
896147
public function years($years)
    {
        return sprintf($this->formatPattern, $years, $this->year_words[$this->pluralization($years)]);
    }
1206176
private static function getYears(): array
    {
        $years = [-1 => static::getConstant('TXT_DATETIME_YYYY', 'TXT_DATETIME_YYYY')];
        for ($i = 1978; $i <= 2037; $i++) {
            $years[$i] = $i;
        }
        return $years;
    }
1251480
public function getYears($limit = 90) {
        $years = array();
        $now_year = date('Y');
        for ($i = 0; $i < $limit; $i++) {
            $years[] = $now_year - $i;
        }
        return $years;
    }
412569
private long yearStart(int year) {
        long ys = 0;
        if (cType == CalculationType.ISLAMIC_CIVIL
                || cType == CalculationType.ISLAMIC_TBLA
                || (cType == CalculationType.ISLAMIC_UMALQURA && (year < UMALQURA_YEAR_START || year > UMALQURA_YEAR_END))) {
            ys = (year-1)*354 + (long)Math.floor((3+11*year)/30.0);
        } else if(cType == CalculationType.ISLAMIC) {
            ys = trueMonthStart(12*(year-1));
        } else if(cType == CalculationType.ISLAMIC_UMALQURA){
            year -= UMALQURA_YEAR_START;
            // rounded least-squares fit of the dates previously calculated from UMALQURA_MONTHLENGTH iteration
            int yrStartLinearEstimate = (int)((354.36720 * year) + 460322.05 + 0.5);
            // need a slight correction to some
            ys = yrStartLinearEstimate + UMALQURA_YEAR_START_ESTIMATE_FIX[year];
        }
        return ys;
    }