Look at the DateTime.Subtract method, which will subtract two dates,
returning a TimeSpan,
which will tell you the number of years the two dates are apart. One of
your DateTimes would be
DateTime.Now, the other the date of the person's birth.
If your timing was great, the two different uses of DateTime.Now could be on
different dates. Only problematic I believe, if the second one is the
birthday date.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.