JavaScript setUTCFullYear()

The JavaScript date setUTCFullYear() method sets the year value for the particular date on the basis of universal time.

Syntax:

dateObj.setUTCFullYear(new_years);

Parameters:
new_years: Integer value which represents a year.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var today =new Date();
document.writeln(today.getUTCFullYear()+"<br>");
today.setUTCFullYear(2019);
document.writeln(today.getUTCFullYear());
</script>
</body>
</html>