JavaScript Reference/Javascript Methods/setHours — различия между версиями

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

Текущая версия на 08:22, 26 мая 2010

"setHours()" Example

    
<html>
<body>
<button onclick="var myDate = new Date(); myDate.setHours(12); alert(myDate);">SETHOURS</button>
</body>
</html>



"setHours()" is applied to

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



"setHours()" Syntax, Parameters and Note

Note:
Sets the hour.
    
Syntax:
    
dateName.setHours(param1, param2, param3, param4)
Parameters:
    param1   Required; the hour. Value: 0 to 23.
    param2   Optional; the minute. Value: 0 to 59.
    param3   Optional; the seconds. Value: 0 to 59.
    param4   Optional; the milliseconds that have elapsed during the current second. 
                       Value: 0 to 999.