Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function elapsedDays(p_strDate)
- {
- const dt1 = new Date(p_strDate);
- const dtNow = new Date(Date.now());
- const intMSPerDay = 1000 * 60 * 60 * 24;
- const diffInTime = dtNow.getTime() - dt1.getTime();
- return diffInDays = Math.round(diffInTime / intMSPerDay);
- }
- elapsedDays("2021-11-30" );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement