Answers for "typescript calculate days between dates"

2

typescript calculate days between dates

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));
Posted by: Guest on May-20-2021

Code answers related to "typescript calculate days between dates"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language