I don't know Delphi, but here is a simple answer that you can use. Basically the first thing I do is convert the birthday and the current date in to days, and subtract the two. From that value you get all your answers. This doesn't take into account leap years. You could easily include this by either dividing by 365.25 (approximate answer) or by determining the number of leap days between now and then adding it to the total (tYear-days % 4 (modulos))

class AgeCalculator {

public final static int[] DAYSINMONTH = {12,28,31,30,31,30,31,31,30,31,30,31};

public static void main(String[] args){

CalculateAge(21, 5, 75, 20, 3, 100);

}

public static void CalculateAge(int day, int month, int year, int tDay, int tMonth, int tYear){

int then = year*365;

for(int i = 0; i<month; i++) then += DAYSINMONTH[i];

then += day;

int today = tYear*365;

for(int i = 0; i<tMonth; i++) today += DAYSINMONTH[i];

today += tDay;

double daysOld = today - then;

double monthsOld = daysOld/12;

double yearsOld = daysOld/365;

System.out.println("Days Old = " + daysOld);

System.out.println("Months Old = " + monthsOld);

System.out.println("Years Old = " + yearsOld);

}

}

class AgeCalculator {

public final static int[] DAYSINMONTH = {12,28,31,30,31,30,31,31,3

public static void main(String[] args){

CalculateAge(21, 5, 75, 20, 3, 100);

}

public static void CalculateAge(int day, int month, int year, int tDay, int tMonth, int tYear){

int then = year*365;

for(int i = 0; i<month; i++) then += DAYSINMONTH[i];

then += day;

int today = tYear*365;

for(int i = 0; i<tMonth; i++) today += DAYSINMONTH[i];

today += tDay;

double daysOld = today - then;

double monthsOld = daysOld/12;

double yearsOld = daysOld/365;

System.out.println("Days Old = " + daysOld);

System.out.println("Months

System.out.println("Years Old = " + yearsOld);

}

}