Date.getFullYear

getFullYear – Get the year, according to local time (four digits).

Description

Date.getFullYear()

Return values

Integer

Examples

Example #1 – getFullYear example
var date = new Date(2015, 9, 21, 16, 29, 00); console.log(date.getFullYear()); // 2015 console.log(new Date().getFullYear()); // Gets the current year.

External references