Return the start of a minute for the given date.
Return the start of a minute for the given date. The result will be in the local timezone.
// CommonJS
var startOfMinute = require('date-fns/startOfMinute')
// ES 2015 import startOfMinute from 'date-fns/startOfMinute'
// ESM
import { startOfMinute } from 'date-fns'
startOfMinute(date)
| Name | Description |
|---|---|
date |
the original date |
| Description |
|---|
|
the start of a minute |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// The start of a minute for 1 December 2014 22:15:45.400: const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) //=> Mon Dec 01 2014 22:15:00
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/startOfMinute