Add the specified number of minutes to the given date.
Add the specified number of minutes to the given date.
// CommonJS
var addMinutes = require('date-fns/addMinutes')
// ES 2015 import addMinutes from 'date-fns/addMinutes'
// ESM
import { addMinutes } from 'date-fns'
addMinutes(date, amount)
| Name | Description |
|---|---|
date |
the date to be changed |
amount |
the amount of minutes to be added. Positive decimals will be rounded using |
| Description |
|---|
|
the new date with the minutes added |
| Type | Description |
|---|---|
TypeError |
2 arguments required |
// Add 30 minutes to 10 July 2014 12:00:00: const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) //=> Thu Jul 10 2014 12:30:00
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/addMinutes