Example usage for java.time Instant isSupported

List of usage examples for java.time Instant isSupported

Introduction

In this page you can find the example usage for java.time Instant 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) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.isSupported(ChronoField.YEAR));
}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.isSupported(ChronoUnit.DAYS));

}