JavaScript Code


JavaScript – Get UTC Full Year from Date


Date – getUTCFullYear()

date.getUTCFullYear()

getUTCFullYear() returns the full year of this date object, according to universal time

Examples

1. get the full year for the current date according to universal time

let date = new Date();
console.log(date);
console.log(date.getUTCFullYear());