UNPKG

781 BTypeScriptView Raw
1import type { DateArg } from "./types.js";
2/**
3 * @name differenceInMilliseconds
4 * @category Millisecond Helpers
5 * @summary Get the number of milliseconds between the given dates.
6 *
7 * @description
8 * Get the number of milliseconds between the given dates.
9 *
10 * @param laterDate - The later date
11 * @param earlierDate - The earlier date
12 *
13 * @returns The number of milliseconds
14 *
15 * @example
16 * // How many milliseconds are between
17 * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
18 * const result = differenceInMilliseconds(
19 * new Date(2014, 6, 2, 12, 30, 21, 700),
20 * new Date(2014, 6, 2, 12, 30, 20, 600)
21 * )
22 * //=> 1100
23 */
24export declare function differenceInMilliseconds(
25 laterDate: DateArg<Date> & {},
26 earlierDate: DateArg<Date> & {},
27): number;