JavaScript Reference/Javascript Methods/setUTCHours

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

"setUTCHours()" Example

<button onclick="var myDate = new Date(); myDate.setUTCHours(11); alert(myDate);">SETUTCHOURS</button>

"setUTCHours()" is applied to

| Applied_To     |Date                                                          |

"setUTCHours()" Syntax, Parameters and Note

Uses UTC time to set the hour.
dateName.setUTCHours(param1, param2, param3, param4)
    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 elapsed in the current second. 
                       Value: 0 to 999.