JavaScript Reference/Javascript Methods/getFullYear

Материал из Web эксперт
Перейти к: навигация, поиск

"getFullYear()" Example

    
<html>
<body>
<button onclick="var myDate = new Date(); alert(myDate.getFullYear());">
get full year from date</button>
</body>
</html>



"getFullYear()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |Date                                                          |
+----------------+--------------------------------------------------------------+



"getFullYear()" Syntax, Parameters and Note

Note:
Returns the four-digit year.
    
Syntax:
    
dateName.getFullYear()