Example usage for java.time YearMonth getLong

List of usage examples for java.time YearMonth getLong

Introduction

In this page you can find the example usage for java.time YearMonth getLong.

Prototype

@Override
public long getLong(TemporalField field) 

Source Link

Document

Gets the value of the specified field from this year-month as a long .

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    long m = y.getLong(ChronoField.YEAR);
    System.out.println(m);/*from  w w w  . ja  va 2s .  com*/

}