Provides a method to calculate the age of person with several helper methods shown in the readme file.
$ dotnet add package PayneAgeCalculatorCalculates the age of person
Provide a date in the past using today as the date to calulate too.
DateTime birthDate = new DateTime(1956, 9, 24);
Console.WriteLine(birthDate.Age().YearsMonthsDays);
Provide a date in the past and a future date
var result = birthDate.Age(DateTime.Now);
Console.WriteLine(result.YearsMonthsDays);
Include hours and minutes
Console.WriteLine($"{result.YearsMonthsDays} {result.Hours}:{result.Minutes}");
Or
Console.WriteLine(result.YearsMonthsDaysTime);
Include seconds
Console.WriteLine($"{result.YearsMonthsDays} {result.Hours}:{result.Minutes}:{result.Seconds}");
NuGet package myage which is the same as this library but a dotnet tool.