Answers for "javascript Find the number of days between two days"

0

javascript Find the number of days between two days

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
Posted by: Guest on September-28-2021

Code answers related to "javascript Find the number of days between two days"

Code answers related to "Javascript"

Browse Popular Code Answers by Language