JavaScript Date setUTCHours()
JavaScript Date setUTCHours()
The setUTCHours() method is used for setting the hour of a date object according to UTC. We can also use it to set the minutes, seconds, and milliseconds.
Syntax:-
Its syntax is:- Date.setUTCHours(hour, min, sec, milliseconds)
Return:-
Its return is:- number of milliseconds of new date from 1 January, 1970
Further Explanation:-
Parameter | Description |
---|---|
hour | Required. An integer representing the hour from 0 - 23. |
min | Optional. An integer represents the minutes. from 0 - 59. |
sec | Optional. An integer representing the seconds from 0 - 59. |
milliseconds | Optional. An integer representing the milliseconds from 0 - 999. |