ES6 - getUTCFullYear() Method


Advertisements


JavaScript date getUTCFullYear() method returns the year in the specified date according to universal time. The value returned by getUTCFullYear is an absolute number that is compliant with year-2000, for example, 2008.

Syntax

Date.getUTCFullYear ()  

Return Value

Returns the year in the specified date according to universal time.

Example

var dt = new Date( "December 25, 1995 23:15:20" ); 
console.log("getUTCFullYear() : " + dt.getUTCFullYear() );   

Output

getUTCFullYear() : 1995    

es6_date.htm

Advertisements
E-Books Store