setSeconds (JavaScript)

Sets the second in local time. Optionally sets the millisecond.

Defined in

Date (Standard - JavaScript)

Syntax

setSeconds(sec:int) : long

setSeconds(sec:int, ms:int) : long

Parameters Description
sec The second in local time where the seconds in a minute are 0 through 59.
ms The millisecond in local time where the milliseconds in a second are 0 through 999.
Return value Description
long The new time in numeric format.

Examples

This computed label sets the current time with the second and millisecond at 0.
var date = new Date();
date.setSeconds(0, 0);
date.toLocaleTimeString()