Example usage for java.time YearMonth until

List of usage examples for java.time YearMonth until

Introduction

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

Prototype

@Override
public long until(Temporal endExclusive, TemporalUnit unit) 

Source Link

Document

Calculates the amount of time until another year-month in terms of the specified unit.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    long s = y.until(YearMonth.of(1990, Month.JANUARY), ChronoUnit.YEARS);
    System.out.println(s);//from ww w  .ja  v  a2 s . c  om

}