Example usage for java.time ZonedDateTime get

List of usage examples for java.time ZonedDateTime get

Introduction

In this page you can find the example usage for java.time ZonedDateTime get.

Prototype

@Override 
public int get(TemporalField field) 

Source Link

Document

Gets the value of the specified field from this date-time as an int .

Usage

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();

    System.out.println(dateTime.get(ChronoField.YEAR));
}