Answers for "how many days old am i"

1

how many days old am i

let date = [2000, 1, 1]
// date[0] = year
// date[1] = month
// date[2] = date
console.log((new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) - new Date(date[0], date[1] - 1, date[2])) / 1000 / 60 / 60 / 24)
Posted by: Guest on August-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language