import java.time.LocalDate;
import java.time.Period;

public class Main {
	public static void main(String[] args) {
		LocalDate startDate = LocalDate.of(2005, 7, 1);
		LocalDate endDate = LocalDate.of(2011, 9, 3);
		Period period = startDate.until(endDate);
		System.out.println(period);

		// Custom format
		String formatted = String.format("%d years, %d months, %d days", period.getYears(), period.getMonths(),
				period.getDays());
		System.out.println(formatted);
	}
}