🖌️
FC.Extension
  • FC.Extension
  • How to Use?
  • Release Note
  • FC.Extension.List
    • ToDataTable
  • FC.Extension.Date
    • Age
  • FC.Extension.String
    • Encrypt
    • Decrypt
    • Truncate a String
  • SQL
    • SQL Extension
    • PostgreSQL Extension
Powered by GitBook
On this page
  • Age Calculation
  • Get Age & Month

Was this helpful?

  1. FC.Extension.Date

Age

Calculate Age

Age Calculation

Calculate Age based

using FC.Core.Extension.DateHandlers;


DateTime dtAge = new DateTime(2016, 02, 25);
int age = dtAge.Age();           
_output.WriteLine($"Age of person born at {dtAge.ToLongDateString()} is '{age}'");

Get Age & Month

using FC.Core.Extension.DateHandlers;

DateTime dtAge = new DateTime(2016, 02, 25);
int age = dtAge.Age();
double month = dtAge.AgeInMonth();
_output.WriteLine($"Age of person born at {dtAge.ToLongDateString()} is '{age}' Month {month}");

PreviousFC.Extension.DateNextFC.Extension.String

Last updated 3 years ago

Was this helpful?