setMinutes

Commons
stable

Return a new Date with the minutes field replaced by the given count. The original date is never mutated.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

date
required
Date
The source date. It is cloned before the minutes field is updated.
count
required
number
The minutes value to set (0–59).

API

Return value

The value returned by this util.

A new Date object with the specified minutes field.

Usage

Examples

Ready-to-paste usage snippets.

Set minutes on a time value

typescript