Files
SnowLuma/.pnpm-store/v11/files/f3/0ff788016e03896f68b954e9e045b43d1a54788bc7212e331c7e1a82c84b26ba56bbdf2d081badf9d7601df85e0573f06f6644578b1b9a42ce5c5f9b84701d
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

16 lines
542 B
Plaintext

import { DateInput } from './types';
/**
* Calculates the difference in hours 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 hours between the two dates.
* @example
* ```ts
* diffInHours(new Date(2023, 0, 1), new Date(2023, 0, 2)) // 24
* ```
*/
export default function diffInHours(date: Date, input: DateInput, asFloat?: boolean): number;