JavaScript Reference/Javascript Methods/setSeconds

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

"setSeconds()" Example

    
<html>
<body>
<button onclick="var myDate = new Date(); myDate.setSeconds(20); alert(myDate);">SETSECONDS</button>
</body>
</html>



"setSeconds()" is applied to

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



"setSeconds()" Syntax, Parameters and Note

Note:
Sets the seconds.
    
Syntax:
    
dateName.setSeconds(param1, param2)
Parameters:
    param1   Required; the seconds. Value: 0 to 59.
    param2   Optional; the milliseconds elapsed in the current second. 
                       Value: 0 to 999.