📜  从 localdate java 代码示例计算年龄

📅  最后修改于: 2022-03-11 14:52:30.288000             🧑  作者: Mango

代码示例2
public int calculateAge(
  LocalDate birthDate,
  LocalDate currentDate) {
    // validate inputs ...
    return Period.between(birthDate, currentDate).getYears();
}