Files
NapCatQQ/.pnpm-store/v3/files/b8/eeb6e20053edd638f7da465afcfbfb33b4ab76aeb59943da3bc72806d501880e1d4f997bce08b8d1480578b997fc7a8d0fd1763a93e4eba5851637c8bd0545
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

17 lines
680 B
Plaintext

/**
* Adds a specified number of years to a date.
* 向日期添加指定数量的年份。
*
* @param date - The date to add years to. (要添加年份的日期。)
* @param years - The number of years to add. (要添加的年份数。)
* @returns A new date with the added years. (添加年份后的新日期。)
* @example
* ```ts
* // Adding 2 years to a date (向日期添加2年)
* const originalDate = new Date('2023-10-01T12:00:00');
* addYears(originalDate, 2);
* console.log(originalDate.toISOString()); // Outputs: '2025-10-01T12:00:00.000Z' (输出: '2025-10-01T12:00:00.000Z')
* ```
*/
export default function addYears(date: Date, years: number): Date;