28 lines
781 B
TypeScript
28 lines
781 B
TypeScript
|
import type { DateArg } from "./types.js";
|
||
|
/**
|
||
|
* @name differenceInMilliseconds
|
||
|
* @category Millisecond Helpers
|
||
|
* @summary Get the number of milliseconds between the given dates.
|
||
|
*
|
||
|
* @description
|
||
|
* Get the number of milliseconds between the given dates.
|
||
|
*
|
||
|
* @param laterDate - The later date
|
||
|
* @param earlierDate - The earlier date
|
||
|
*
|
||
|
* @returns The number of milliseconds
|
||
|
*
|
||
|
* @example
|
||
|
* // How many milliseconds are between
|
||
|
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
||
|
* const result = differenceInMilliseconds(
|
||
|
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
||
|
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
||
|
* )
|
||
|
* //=> 1100
|
||
|
*/
|
||
|
export declare function differenceInMilliseconds(
|
||
|
laterDate: DateArg<Date> & {},
|
||
|
earlierDate: DateArg<Date> & {},
|
||
|
): number;
|