Find the number of days between two days

PHOTO EMBED

Wed Jan 05 2022 11:23:16 GMT+0000 (Coordinated Universal Time)

Saved by @desiboli ##javascript ##js

const dayDif = (date1, date2) => Math.ceil(Math.abs(date1.getTime() - date2.getTime()) / 86400000)
dayDif(new Date("2020-10-21"), new Date("2021-10-22"))
// Result: 366
content_copyCOPY

Find the days between 2 given days using the following snippet.

https://blog.devgenius.io/15-javascript-codes-you-will-always-need-e8569903dd1