how to calculate the age from birthday in java

https:/‮w/‬ww.lautturi.com
how to calculate the age from birthday in java
/**
 * @author lautturi.com 
 * Java example: how to get number of years between two dates in java
 */

import java.util.*;
import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.*;

public class Lautturi {

	public static void main(String[] args){

		LocalDate birthday = LocalDate.parse("2000-10-13");
		LocalDate now = LocalDate.now();

		long diff = ChronoUnit.YEARS.between(birthday, now);

	    System.out.println("The age is: " +  diff);

	}
}

output:

The age is: 19
Created Time:2017-09-24 20:26:36  Author:lautturi