Example usage for java.time Year now

List of usage examples for java.time Year now

Introduction

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

Prototype

public static Year now(Clock clock) 

Source Link

Document

Obtains the current year from the specified clock.

Usage

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.now(Clock.systemDefaultZone());
    System.out.println(y);

}

From source file:Main.java

public static void main(String[] args) {
    Year y = Year.now(ZoneId.systemDefault());
    System.out.println(y);

}