Date.setUTCFullYear

setUTCFullYear – Set the year, according to universal time (four digits).

Description

Date.setUTCFullYear(integer year)

Parameters

Name Description Type Default Optional
year integer No

Return values

Integer. The new timestamp.

Examples

Example #1 – setUTCFullYear example
var date = new Date(Date.UTC(2015, 9, 21, 16, 29, 00)); console.log(date.getTime()); // 1445444940000 console.log(date.setUTCFullYear(2000)); // 972145740000

External references