calculateAge static method

AgeResult calculateAge(
  1. DateTime birthDate, {
  2. bool useUtc = false,
})

Calculates the exact age from a date of birth.

Implementation

static AgeResult calculateAge(DateTime birthDate, {bool useUtc = false}) {
  DateTime today = useUtc ? DateTime.now().toUtc() : DateTime.now();
  return _calculateExactAge(birthDate, today);
}