Example usage for java.time ZonedDateTime isSupported

List of usage examples for java.time ZonedDateTime isSupported

Introduction

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

Prototype

@Override 
public boolean isSupported(TemporalUnit unit) 

Source Link

Document

Checks if the specified unit is supported.

Usage

From source file:Main.java

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

    System.out.println(dateTime.isSupported(ChronoUnit.YEARS));
}

From source file:Main.java

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

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