obtener edad a partir de la fecha de nacimiento en java code example
Example: java calcular años
public class PeriodClass {
static void calculatePeriod(LocalDate startDate,
LocalDate endDate)
{
Period period = Period.between(startDate, endDate);
System.out.println("Period between start and end "
+ "date is : " + period);
}
public static void main(String[] args)
{
LocalDate startDate = LocalDate.parse("2017-02-13");
LocalDate endDate = LocalDate.parse("2018-08-20");
calculatePeriod(startDate, endDate);
}
}