Java Data Type How to - Get Period between two LocalDate


We would like to know how to get Period between two LocalDate.


/* w w  w . j  a v  a2  s  . com*/
import java.time.LocalDate;
import java.time.Period;

public class Main {
  public static void main(String[] args) {

    LocalDate firstDate = LocalDate.of(2013, 5, 17); 
    LocalDate secondDate = LocalDate.of(2015, 3, 7); 
    Period period = Period.between(firstDate, secondDate);


The code above generates the following result.