---
title: Date.prototype.getFullYear
---
## Date.prototype.getFullYear

Date.getFullYear() method returns the year(four digits) of the specified date according to local time.

### Syntax

```javascript
dateObj.getFullYear()
```

### Example

```javascript
var date = new Date();
// creates a new Date() object with current date and time.
date.getFullYear()
// 2018
```

#### More Information:
[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear)


