offline version v3


139 of 264 menu

setMilliseconds method

The setMilliseconds method allows you to change the number of milliseconds of the date object. It takes the number of milliseconds as the first parameter.

Syntax

date.setMilliseconds(milliseconds);

Example

Let's set the milliseconds for the current date:

let date = new Date(); date.setMilliseconds(999); console.log(date);

See also

enru