Community discussion forum

Calculate Age

This is a comment thread discussing Calculate Age
  • 10 years ago

    This thread is for discussions of Calculate Age.

  • 3 years ago

    Developer Fusion Bot wrote:
    This thread is for discussions of Calculate Age

    Description of calculate age and working principle

  • 2 years ago

    Alternative solution:

    DateTime comparisonDate = new DateTime(_birthday.Year, DateTime.Now.Month, DateTime.Now.Day);

     

    int age = (comparisonDate.Date < _birthday.Date) ?
    DateTime.Now.Year - _birthday.Year - 1:
    DateTime.Now.Year - _birthday.Year;

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback