Set the year field of the date object

@param   int     the year
@return  int     the year
11000
public function year($value = null)
    {
        if ($value !== null) {
            if ($value < 0 || $value > 9999) {
                $this->year = 0;
            } else {
                $this->year = $value;
            }
        }
        return $this->year;
    }
255146
public function setDate($year, $month, $day) {
		$this->set("$year/$month/$day ".$this->format('HH:mm:ss'), null, 'yyyy/MM/dd HH:mm:ss');
		return $this;
	}
1194738
public static function firstDayOfYear($year = null, $format = 'Y-m-d')
    {
        $year = $year ? $year : date('Y');
        return date($format, mktime(0, 0, 0, 1, 1, $year));
    }
526220
public void setDate(int year, int month, int day) {
        Calendar to = Calendar.getInstance();
        to.set(year, month, day);
        setDate(to);
    }
565331
public static int getYear(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.YEAR);
    }
846447
public function withYear(int $year): DateTime
    {
        return new static(
            Date::create($year, $this->month(), $this->day()),
            $this->time(),
            $this->timezone()
        );
    }
411261
public function getYear()
    {
        if (empty($this->year)) {
            throw new LogicException(
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'year')
            );
        }
        return $this->year;
    }
250771
public final void showYear(Year year) {
        requireNonNull(year);
        if (!yearPage.isHidden()) {
            selectedPage.set(getYearPage());
            setDate(year.atDay(1));
        }
    }
1171558
public void setYear(int v) {
    if (Date_Type.featOkTst && ((Date_Type)jcasType).casFeat_year == null)
      jcasType.jcas.throwFeatMissing("year", "de.julielab.jules.types.Date");
    jcasType.ll_cas.ll_setIntValue(addr, ((Date_Type)jcasType).casFeatCode_year, v);}
1342099
def year(columns, name=None):
    

    if columns < 0:
        # Can't have negative size
        raise BaseException()

    field = numeric(columns, name)

    # Parse action
    field.addParseAction(_to_year)

    return field
603127
public void setYear(String newYear)
	{
		if (newYear.length() > YEAR_SIZE)
		{
			year = newYear.substring(0, YEAR_SIZE);
		}
		else
		{
			year = newYear;
		}
	}
19927
public static function year($year = null)
	{
		$from = DateTime::create(1, 1, $year);
		$till = $from->copy()->addYears(1)->addDays(-1);
		return new Calendar($from, $till);
	}
1204805
public function year($column, $operator, $value = null)
    {
        if (func_num_args() < 3) {
            $value = $operator;

            $operator = null;
        }

        $this->addColumn('AND', $column, $operator, $value,
            function (string $column) {
                return 'YEAR(' . $column . ')';
            },

            function (string $value) {
                return (int) $value;
            }
        );

        return $this;
    }
1315534
public static function getDaysInYear($year = null): int
    {
        $year = $year ? $year : date('Y');
        return self::isLeapYear($year) ? 366 : 365;
    }
15963
private static function validateYear($year)
	    {
	        $year = filter_var($year, FILTER_VALIDATE_INT);
	        if (false === $year) {
	            throw new InvalidArgumentException("A Year must be a valid int");
	        }

	        return $year;
	    }
1075619
public function setDate($year, $month, $day)
    {
        list($year, $month, $day) = self::getGregorian($year, $month, $day);

        return parent::setDate($year, $month, $day);
    }
230529
protected function extractYear(string $year): int
    {
        if (preg_match('/^(\d\d\d\d)\/\d{1,4}$/', $year, $match)) {
            // Assume the first year is correct
            $this->new_old_style = true;

            return (int) $match[1] + 1;
        }

        if (preg_match('/^(\d+) B\.C\.$/', $year, $match)) {
            return - (int) $match[1];
        }

        return (int) $year;
    }