function daysBetween
daysBetween(
start: Date,
end: Date
): number

Calculates the number of full days between two dates. The order of the arguments does not matter.

Examples

Example 1

daysBetween(new Date("2026-01-01T00:00"), new Date("2026-01-02T12:00")); // 1
daysBetween(new Date("2026-01-02T12:00"), new Date("2026-01-01T00:00")); // 1

Parameters

start: Date
end: Date

Return Type

number

Usage

import { daysBetween } from ".";