js Date (date) the getFullYear object manipulation ()

Role: Returns the four-digit number representing the year .

Syntax: dateObject.getFullYear ()

Returns: Year when dateObject expressed in local time returned. The return value is a four-digit number indicating the full year including century, including the value, rather than the double-digit abbreviated form.

Tip: This method is always used in conjunction with a Date object.
 

var d = new Date()
    console.log(d.getFullYear()) // 2019

 

Guess you like

Origin blog.csdn.net/qq_33650655/article/details/91564480