ChronoLocalDate lengthOfYear() method in Java with Examples Last Updated : 29 Apr, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The lengthOfYear() method of ChronoLocalDate interface in Java returns the length of the year represented by this date. Syntax: public int lengthOfYear() Parameter: This method does not accept parameters. Return Value: The function returns 366 if the year is leap, 365 otherwise. Below programs illustrate the lengthOfYear() method of ChronoLocalDate in Java: Program 1: Java // Program to illustrate the lengthOfYear() method import java.util.*; import java.time.*; import java.time.chrono.*; public class GfG { public static void main(String[] args) { // Parses the date ChronoLocalDate dt1 = LocalDate.parse("2018-11-27"); // Get the length of the year System.out.println(dt1.lengthOfYear()); } } Output: 365 Program 2: Java // Program to illustrate the lengthOfYear() method import java.util.*; import java.time.*; import java.time.chrono.*; public class GfG { public static void main(String[] args) { // Parses the date ChronoLocalDate dt1 = LocalDate.parse("2016-11-27"); // Get the length of the year System.out.println(dt1.lengthOfYear()); } } Output: 366 Reference: https://docs.oracle.com/javase/9/docs/api/java/time/chrono/ChronoLocalDate.html#lengthOfYear-- Comment More infoAdvertise with us Next Article LocalDate until(ChronoLocalDate) Method in Java with Examples K Kirti_Mangal Follow Improve Article Tags : Java Java-Functions Java-time package Java-ChronoLocalDate Practice Tags : Java Similar Reads ChronoLocalDate lengthOfMonth() method in Java with Examples The lengthOfMonth() method of ChronoLocalDate interface in Java returns the length of the month represented by this date. Syntax: public int lengthOfMonth() Parameter: This method does not accept parameters. Return Value: The function returns the length of the month in days. Below programs illustrat 1 min read ChronoLocalDate get() method in Java with Examples The get() method of ChronoLocalDate interface in Java method gets the value of the specified field from this Date as an int. Syntax: public int get(TemporalField field) Parameter: This method accepts a parameter field which is the field to get and not necessary null. Return Value: It returns the val 2 min read ChronoLocalDate isLeapYear() method in Java with Examples The isLeapYear() method of ChronoLocalDate interface in Java checks if the year is leap year or not. Syntax: public boolean isLeapYear() Parameter: This method does not accept parameters. Return Value: The function returns true if the year is leap, false otherwise. Below programs illustrate the isLe 1 min read LocalDate until(ChronoLocalDate) Method in Java with Examples 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 Lo 2 min read ChronoLocalDate getLong() method in Java with Examples The getLong() method of ChronoLocalDate interface in Java gets the era applicable at this date. Syntax: public long getLong(TemporalField field) Parameter: This method accepts a single mandatory parameter field which specifies the field to get and not null. Return Value: The function returns the val 2 min read ChronoLocalDate with(TemporalField, long) Method in Java with Examples with(TemporalField field, long newValue) method of the ChronoLocalDate interface used to set the specified field of ChronoLocalDate to a new value and returns the copy of new date-time.This method can be used to change any supported field, such as the year, month or day-of-month. An exception is thr 2 min read Like