Sets the year of the UTC date. The year must be given with four digits (2007 instead of just 07).
var myDate = new Date();
//from w w w . ja v a 2s . c o m
myDate.setUTCFullYear(2012);
console.log(myDate.toString());
The code above generates the following result.