JavaScript Reference/Javascript Methods/setUTCMonth

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

"setUTCMonth()" Example

    
<html>
<body>
<button onclick="var myDate = new Date(); myDate.setUTCMonth(2); alert(myDate);">SETUTCMONTH</button>
</body>
</html>



"setUTCMonth()" is applied to

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



"setUTCMonth()" Syntax, Parameters and Note

Note:
Use UTC time to set the month.
    
Syntax:
    
dateName.setUTCMonth(param1, param2)
Parameters:
    param1   Required; the month. Value: 0 to 11.
    param2   Optional; the day of the month. Value: 1 to 31.