function GetAge(BirDate : TDate) : Integer;
var
BirYear, BirMonth, BirDay : Word;
NowYear, NowMonth, NowDay : Word;
begin
DecodeDate(Date, NowYear, NowMonth, NowDay);
DecodeDate(BirDate, BirYear, BirMonth, BirDay);
if NowMonth > BirMonth then
Result := NowYear - BirYear
else if NowMonth = BirMonth then
if NowDay >= BirDay then
Result := NowYear - BirYear
else
Result := NowYear - BirYear - 1;
else
Result := NowYear - BirYear - 1;
end;