Class GetAgeFromBirthDate

java.lang.Object
javatapas.util.GetAgeFromBirthDate

public class GetAgeFromBirthDate
extends Object
Version:
2021-05-27
Author:
Kodiak Brown
  • Constructor Details

    • GetAgeFromBirthDate

      public GetAgeFromBirthDate()
  • Method Details

    • getAgeFromBirthDate

      public static int getAgeFromBirthDate​(Calendar birthDate, Calendar refDate)
      Calculate the Age in Years given a Birth Date and a Reference Date
      Parameters:
      birthDate - The birth date of a person, place or thing.
      refDate - The reference date from the which the age should be calculated from. To get the age of something in 10 years, the reference date should be a Calendar object created from today's date plus 10 years.
      Returns:
      The Age in Years.
    • getAgeFromBirthDate

      public static int getAgeFromBirthDate​(Calendar birthDate)
      Calculate the Age in Years as of right now given a Birth Date. The reference date is the time/date at the time when this method is called.
      Parameters:
      birthDate - The birth date of a person, place or thing.
      Returns:
      The Age in Years.
    • getAgeFromBirthDate

      public static int getAgeFromBirthDate​(int birthDay, int birthMonth, int birthYear)
      Calculate the Age in Years as of right now given a Birth Date. The birth date is represented as Day, Month and Year integers.
      Parameters:
      birthDay - The numeric day of the month the person/place/thing was born on.
      birthMonth - The numeric month the person/place/thing was born in.
      birthYear - The year the person/place/thing was born in.
      Returns:
      The Age in Years.