📌  相关文章
📜  typescript 计算日期之间的天数 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:27.545000             🧑  作者: Mango

代码示例1
let startDate: string = "2021-04-01";
let date1: Date = new Date();
let date2: Date = new Date(startDate);
let timeInMilisec: number = date1.getTime() - date2.getTime();
let daysBetweenDates: number = Math.ceil(timeInMilisec / (1000 * 60 * 60 * 24));