Here is a problem. I have seen many solutions, but no one seems to be fulfilling the criteria I want...
I want to display the age in this format
20 y
write this small function to have the number of leap year days between the current year and the date of birth year and add the returned days to the days part of your age:
private static int NumberOfLeapYears(int startYear, int endYear)
{
int counter = 0;
for (int year = startYear; year <= endYear; year++)
counter += DateTime.IsLeapYear(year) ? 1 : 0;
return counter;
}