I need to calculate the age of a person taking in consideration the years, months and days to check if the person is under 14 or not.The return result should be boolean if the person is under 14 or not. I tried with this code but I'm getting an error of conversion.
var under14 = false;
string person.DateOfBirth = "04/01/2012";
var DateOfBirth = Convert.ToInt32(person.DateOfBirth);
var ageDifMs = Convert.ToInt32(DateTime.Now) - DateOfBirth;
var ageDate = new DateTime(ageDifMs);
var age = Math.Abs(ageDate.Year - 1970);
if (age < 14)
under14 = true;