I'm not sure that it will always be correct (I did not think about whether there were any cases with leap years, etc., which could lead to its failure ...), but this is an easy way to get out of the year and month: / p>
DateTime bd = DateTime.Parse("2009-06-17"); TimeSpan ts = DateTime.Now.Subtract(bd); DateTime age = DateTime.MinValue + ts; string s = string.Format("{0} Years {1} months {2} days", age.Year -1 , age.Month - 1, age.Day - 1);
Hans olsson
source share