C#根据生日计算准确年龄的方法 0 By 董德多 on 2019年7月24日 C# C#根据生日计算年龄的方法: var today = DateTime.Today;//当前日期 var age = today.Year - birthdate.Year;//计算年龄 // 判断生日是否已过,返回准确年龄 if (birthdate > today.AddYears(-age)) age--; 年龄 生日