LocalDate until(ChronoLocalDate) Method in Java with Examples Last Updated : 24 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report until() method of the LocalDate class used to get the difference between this Local date and another date passed as a parameter and return the difference in term of Period object. This operation is performed in terms of years, months and days and return the answer in same. The start point is this LocalDate and the endpoint is the specified date passed as a parameter. when the start point is the after in term of date than the endpoint then the return value is negative.ISO calendar is very important for this method because the calculation is performed using the ISO calendar system. Syntax: public Period until(ChronoLocalDate endDateExclusive) Parameters: This method accepts one parameter endDateExclusive which is the end date, exclusive, which may be in any chronology, It should not be null. Return value: This method returns the period between this date and the end date. Below programs illustrate the until() method: Program 1: Java // Java program to demonstrate // LocalDate.until() method import java.time.*; import java.time.temporal.*; public class GFG { public static void main(String[] args) { // create LocalDate objects LocalDate l1 = LocalDate .parse("2018-12-06"); LocalDate l2 = LocalDate .parse("2018-10-25"); // apply until the method of LocalDate class Period result = l2.until(l1); // print results System.out.println("Result in Period: " + result); } } Output: Result in Period: P1M11D Program 2: Java // Java program to demonstrate // LocalDate.until() method import java.time.*; import java.time.temporal.*; public class GFG { public static void main(String[] args) { // create LocalDate objects LocalDate l1 = LocalDate .parse("2018-12-06"); LocalDate l2 = LocalDate .parse("2018-12-15"); // apply until() Period result = l2.until(l1); // print results System.out.println("Result in Period: " + result); } } Output: Result in Period: P-9D References: https://docs.oracle.com/javase/10/docs/api/java/time/LocalDate.html#until(java.time.chrono.ChronoLocalDate) Comment More infoAdvertise with us Next Article ChronoLocalDate range() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions Java-time package Java-LocalDate Practice Tags : Java Similar Reads ChronoLocalDateTime until() method in Java with Examples until() method of the ChronoLocalDateTime interface used to calculate the amount of time between two ChronoLocalDateTime objects using TemporalUnit. The start and end points are this and the specified ChronoLocalDateTime passed as a parameter. The result will be negative if the end is before the sta 2 min read ChronoLocalDate query() Method in Java with Examples query() method of an ChronoLocalDate interface used to query this ChronoLocalDate using the specified query as parameter. The TemporalQuery object passed as parameter define the logic to be used to obtain the result from this ChronoLocalDate. Syntax: public <R> R query(TemporalQuery<R> q 2 min read ChronoLocalDate range() method in Java with Examples The range() method of a ChronoLocalDate interface is used to get the range of valid values for the field passes as a parameter. This method returns a ValueRange object which contains the minimum and maximum valid values for a field. When the field is not supported then an exception is thrown. This C 2 min read LocalDateTime until() Method in Java with Examples until() method of the LocalDateTime class used to calculate the amount of time between two LocalDateTime objects using TemporalUnit. The start and end points are this and the specified LocalDateTime passed as a parameter. The result will be negative if the end is before the start. The calculation re 2 min read ChronoLocalDate from() method in Java with Examples The from() method of ChronoLocalDate interface in Java method obtains an instance of ChronoLocalDate from a temporal object. Syntax: public static ChronoLocalDate from(TemporalAccessor temporal) Parameter: This method accepts a parameter temporal which specifies the temporal object to convert and no 1 min read LocalTime until() Method in Java with Examples until() method of the LocalTime class used to calculate the amount of time between two LocalTime objects using TemporalUnit. The start and end points are this and the specified LocalTime passed as a parameter. The result will be negative if the end is before the start. The calculation returns a whol 2 min read Like