Files
SnowLuma/.pnpm-store/v11/files/25/6090d84ce8ad355a44a87c9fb04727f6fad15ebc8a45096a7cd402af2173b8f088de702d67848051eba029f6fcacb0f8b689fd58d960612032ce0bdd83cadd
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

18 lines
695 B
Plaintext

import { DateInput } from './types';
/**
* Calculates the difference in milliseconds between two dates.
* 计算两个日期之间的毫秒差
*
* @param date - The first date to compare.
* @param input - The second date to compare.
* @param asFloat - Whether to return the result as a float.
* @returns The difference in milliseconds between the two dates.
* @example
* ```ts
* diffInMilliseconds(new Date(), new Date()); // 0
* diffInMilliseconds(new Date(), new Date(Date.now() + 1000)); // 1000
* diffInMilliseconds(new Date(), new Date(Date.now() - 1000)); // -1000
* ```
*/
export default function diffInMilliseconds(date: Date, input: DateInput, asFloat?: boolean): number;