Given a DateTime representing a person\'s birthday, how do I calculate their age in years?
DateTime
Keeping it simple (and possibly stupid:)).
DateTime birth = new DateTime(1975, 09, 27, 01, 00, 00, 00); TimeSpan ts = DateTime.Now - birth; Console.WriteLine("You are approximately " + ts.TotalSeconds.ToString() + " seconds old.");