Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 753 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 753 Bytes

AgeCalc.cs

C# Age Calculation Library

Installation

# Using NuGet Package Manager Console:
PM> Install-Package Faisalman.AgeCalc

# Using NuGet .NET CLI:
dotnet add package Faisalman.AgeCalc

Usage Example

using System;
using Faisalman.AgeCalc;

class Program
{
  static void Main(string[] args)
  {
    DateTime bday = new DateTime(1970, 8, 21);
    DateTime cday = new DateTime(2014, 4, 30);
    Age age = new Age(bday, cday);
    
    Console.WriteLine("It's been {0} years, {1} months, and {2} days since your birthday", age.Years, age.Months, age.Days);
    // output: "It's been 43 years, 8 months, and 9 days since your birthday";
  }
}

License

MIT License

Copyright © 2013 Faisal Salman <[email protected]>