dateToMilliseconds()
Returns the number of milliseconds (JavaScript timestamp) representing a given date.
Usage
import { dateToMilliseconds } from 'easy-dates';
dateToMilliseconds(date)
Prop types
prop | type | required | default |
---|---|---|---|
date | date | yes | null |
Examples
dateToMilliseconds(new Date("2022-01-01")) // 1640995200000
dateToMilliseconds("2022-01-01") // Error