esse codigo é pra calcular a idade so que ela esta retornado errada… se por 30/08/1980 na data de nascimento ela retorna 27 anos… algum ajuda.
<% String data="";
Date calc,hoje;
int idade;
data=request.getParameter("dtaNascimento");
calc=new Date(data);
hoje=new Date();
int dia=calc.getYear();
int age=hoje.getYear()-calc.getYear();
if((hoje.getMonth() > calc.getMonth()) && (hoje.getDay() >= calc.getDay()))
idade=age-1;
else
idade=age;
out.println("Idade: "+idade+" anos"); %> <br/>