offline version v3


137 of 264 menu

setMinutes method

The setMinutes method allows you to change the number of minutes for the date object. It takes the number of minutes as the first parameter, it can also take seconds and milliseconds as the second and third optional parameters.

Syntax

date.setMinutes(minutes, [seconds], [milliseconds]);

Example

Let's set the minutes for the current time:

let date = new Date(); date.setDate(59); console.log(date);

Example

Let's set the minutes and seconds for the current point in time:

let date = new Date(); date.setDate(59, 59); console.log(date);

See also

enru