从Java LocalDate获取年龄
//package com.nowjava; import java.time.LocalDate; //来 自 NowJava.com - 时代Java import java.time.temporal.ChronoUnit; public class Main { public static long getAge(LocalDate date) { return ChronoUnit.YEARS.between(date, LocalDate.now()); } }