Java LocalDate Calculate getAge(LocalDate birthDay)

Here you can find the source of getAge(LocalDate birthDay)

Description

get Age

License

Apache License

Parameter

Parameter Description
LocalDate a parameter

Return

age in years

Declaration

public static int getAge(LocalDate birthDay) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.time.LocalDate;

public class Main {
    /**/*from w w  w  .j  a v a 2  s .co m*/
     * @param LocalDate
     * @return age in years
     */
    public static int getAge(LocalDate birthDay) {
        return LocalDate.now().getYear() - birthDay.getYear();
    }
}

Related

  1. daysAgo(LocalDate pastDate)
  2. doy(LocalDate date)
  3. fastDateWrite(LocalDate localDate)
  4. fastDateWriteWeeks(LocalDate localDate)
  5. getAge(LocalDate birthday)
  6. getDate(ChronoLocalDate date)
  7. getDate(Console console, Function validator)
  8. getDate(final LocalDate localDate)
  9. getDate(LocalDate d, String tzId)