JavaScript Reference/Javascript Methods/getMonth

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

"getMonth()" Example

    
<html>
<body>
<button onclick="var myDate = new Date(); alert(myDate.getMonth());">
get month</button>
</body>
</html>



"getMonth()" is applied to

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



"getMonth()" Syntax, Parameters and Note

Note:
Returns the month. 
Return value: 
0 to 11, 
with 0 representing January and 11 representing December.
    
Syntax:
    
dateName.getMonth()