📅  最后修改于: 2022-03-11 14:48:27.545000             🧑  作者: Mango
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));