Java Utililty Methods Age Calculate

List of utility methods to do Age Calculate

Description

The list of methods to do Age Calculate are organized into topic(s).

Method

intgetAgeFromDate(Date snapshotDate, Date birthdate)
get Age From Date
try {
    Calendar dateOfBirth = new GregorianCalendar();
    dateOfBirth.setTime(birthdate);
    Calendar asOfDate = Calendar.getInstance();
    if (snapshotDate != null)
        asOfDate.setTime(snapshotDate);
    int age = asOfDate.get(Calendar.YEAR) - dateOfBirth.get(Calendar.YEAR);
    dateOfBirth.add(Calendar.YEAR, age);
...