一个易于理解和简单的解决方案。
// Save today's date.var today = DateTime.Today;// Calculate the age.var age = today.Year - birthdate.Year;// Go back to the year the person was born in case of a leap yearif (birthdate.Date > today.AddYears(-age)) age--;
但是,这假设您正在寻找 西方 的年龄观念,而不是使用
东亚估算 。



