Example usage for java.time Year length

List of usage examples for java.time Year length

Introduction

In this page you can find the example usage for java.time Year length.

Prototype

public int length() 

Source Link

Document

Gets the length of this year in days.

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.of(2014);

    System.out.println(y.length());

}

From source file:Main.java

public static void main(String[] args) {
    Year currentYear = Year.now();
    Year twoThousand = Year.of(2000);
    boolean isLeap = currentYear.isLeap(); // false
    int length = currentYear.length(); // 365

    // sixtyFourth day of 2014 (2014-03-05)
    LocalDate date = Year.of(2014).atDay(64);

    System.out.println("year: currentYear: " + currentYear);
    System.out.println("year: twoThousand: " + twoThousand);
    System.out.println("year: isLeap: " + isLeap);
    System.out.println("year: length: " + length);
    System.out.println("year: date: " + date);
}