Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LocalDate birthDate = LocalDate.parse("28.10.1988", DateTimeFormatter.ofPattern("dd.MM.yyyy"));
- LocalDate todayDate = LocalDate.now();
- Period period = Period.between(birthDate, todayDate);
- int years = period.getYears();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement