I implemented this helper for a client wanted to hide the age of users who were younger than 14 years.
public static string AgeDisplay(this HtmlHelper helper, DateTime birthday) { var now = DateTime.Today; var age = now.Year - birthday.Year; var result = ""; if (now < birthday.AddYears(age)) age--; if (age >= 14) // Dont display age, of any users who are younger then 14 years old. { result = age + "years old, "; } return result; }