function getAge(dateString) {
var ageInMilliseconds = new Date() - new Date(dateString);
return Math.floor(ageInMilliseconds/1000/60/60/24/365); // convert to years
}
console.log(getAge('1997-04-23'));
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
return Math.floor(difference/(1000*60*60*24*365));
}
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
Math.floor(difference/(1000*60*60*24*365));
}
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
return Math.floor(difference/(1000*60*60*24*365));
}
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
return Math.floor(difference/(1000*60*60*24*365));
}
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
return Math.floor(difference/(1000*60*60*24*365));
}
getAge() {
let currentTime = new Date().getTime();
let birthDateTime= new Date('DATE GOES HERE').getTime();
let difference = (currentTime - birthDateTime);
Math.floor(difference/(1000*60*60*24*365));
}