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,
options?: DifferenceInMinutesOptions,
): number;§
differenceInMinutes<DateType extends Date>(dateLeft: DateType | number | string, dateRight: DateType | number | string, options?: DifferenceInMinutesOptions): number
[src]§Parameters
§
options?: DifferenceInMinutesOptions optional
[src]- An object with options.