Get the milliseconds timestamp of the given date.
Get the milliseconds timestamp of the given date.
// CommonJS
var getTime = require('date-fns/getTime')
// ES 2015 import getTime from 'date-fns/getTime'
// ESM
import { getTime } from 'date-fns'
getTime(date)
| Name | Description |
|---|---|
date |
the given date |
| Description |
|---|
|
the timestamp |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// Get the timestamp of 29 February 2012 11:45:05.123: const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) //=> 1330515905123
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/getTime