Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

differenceInMilliseconds

import { differenceInMilliseconds } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@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
function differenceInMilliseconds<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): number;
§
differenceInMilliseconds<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string): number
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
dateLeft: DateType | number | string
[src]
  • The later date
§
dateRight: DateType | number | string
[src]
  • The earlier date

§Return Type

§
number
[src]

The number of milliseconds