const date1 = new Date('12/13/2021');
const date2 = new Date('12/15/2021');
const diffTime = Math.abs(date2 - date1);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 *24));
console.log(diffDays);
![Cover image for Dates difference](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1gd5kcr8tzr0hr1ddkd.jpg)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)