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

differenceInMinutes

import { differenceInMinutes } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
const result = differenceInMinutes(
  new Date(2014, 6, 2, 12, 20, 0),
  new Date(2014, 6, 2, 12, 7, 59)
)
//=> 12
@example
// How many minutes are between 10:01:59 and 10:00:00
const result = differenceInMinutes(
  new Date(2000, 0, 1, 10, 0, 0),
  new Date(2000, 0, 1, 10, 1, 59)
)
//=> -1
function differenceInMinutes<DateType extends Date>(
dateLeft: DateType | number | string,
dateRight: DateType | number | string,
): number;
§
differenceInMinutes<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string, options?: DifferenceInMinutesOptions): 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
§
  • An object with options.

§Return Type

§
number
[src]

The number of minutes