JavaScript Date setSeconds()
JavaScript Date setSeconds()
The setSeconds() method is used for setting the seconds of a date object. It can also be used to set milliseconds.
Syntax:-
Its syntax is:- Date.setSeconds(sec, milliseconds)
Return:-
Its return is:- number of milliseconds of new date from 1 January, 1970
Further Explanation:-
Parameter | Description |
---|---|
sec | Required. An integer representing the seconds from 0 - 59. |
milliseconds | Optional. An integer representing the milliseconds from 0 - 999. |