Answers for "calculate age given the birth date in the format yyyymmdd"

0

calculate age given the birth date in the format yyyymmdd

const getAge = birthDate => Math.floor((new Date() - new Date(birthDate).getTime()) / 3.15576e+10)

// today is 2018-06-13
getAge('1994-06-14') // 23
getAge('1994-06-13') // 24
Posted by: Guest on July-16-2021

Code answers related to "calculate age given the birth date in the format yyyymmdd"

Browse Popular Code Answers by Language