Skip to content

Instantly share code, notes, and snippets.

Created Jul 25, 2019
What would you like to do?
public static class DateUtilities
public static int CalculateAge(DateTime birthdate)
var age = DateTime.Today.Year - birthdate.Year;
var temp = new DateTime(DateTime.Today.Year,
birthdate.Month, birthdate.Day);
if (temp > DateTime.Today)
return age;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment