📜  从日期开始的 java 年龄 - Java 代码示例

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

代码示例1
LocalDate today = LocalDate.now();
LocalDate birthday = LocalDate.of(1987, 09, 24);

Period period = Period.between(birthday, today);

//Now access the values as below
System.out.println(period.getDays());
System.out.println(period.getMonths());
System.out.println(period.getYears());