# Date.setFullYear()

The setFullYear() method sets the full year for a specified date according to local time. Returns new timestamp.

```javascript
var event = new Date('August 19, 1975 23:15:30');

event.setFullYear(1969);

console.log(event.getFullYear());
// expected output: 1969

event.setFullYear(0);

console.log(event.getFullYear());
// expected output: 0

```

## Syntax <a href="#syntax" id="syntax"></a>

```javascript
dateObj.setFullYear(yearValue[, monthValue[, dateValue]])
```

#### Parameters <a href="#parameters" id="parameters"></a>

`yearValue`An integer specifying the numeric value of the year, for example, 1995.

`monthValue`*Optional*. An integer between 0 and 11 representing the months January through December.

`dateValue`*Optional*. An integer between 1 and 31 representing the day of the month. If you specify the `dateValue` parameter, you must also specify the `monthValue`.

**Return value**

The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date.

## Description

If you do not specify the `monthValue` and `dateValue` parameters, the values returned from the [`getMonth()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth) and [`getDate()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate) methods are used.

If a parameter you specify is outside of the expected range, `setFullYear()` attempts to update the other parameters and the date information in the [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object accordingly. For example, if you specify 15 for `monthValue`, the year is incremented by 1 (`yearValue + 1`), and 3 is used for the month.

## Examples <a href="#examples" id="examples"></a>

#### Using `setFullYear()` <a href="#using_setfullyear" id="using_setfullyear"></a>

```javascript
var theBigDay = new Date();
theBigDay.setFullYear(1997);
```

## References <a href="#references" id="references"></a>

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear>" %}

## Contributors to this page <a href="#contributors-to-this-page" id="contributors-to-this-page"></a>

Uros Durdevic


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://date.gitbook.io/dateall/javascript/methods/date.setfullyear.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
