Example usage for java.time YearMonth minus

List of usage examples for java.time YearMonth minus

Introduction

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

Prototype

@Override
public YearMonth minus(long amountToSubtract, TemporalUnit unit) 

Source Link

Document

Returns a copy of this year-month with the specified amount subtracted.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    YearMonth s = y.minus(12, ChronoUnit.YEARS);
    System.out.println(s);//from   w  w  w  .j  av  a  2 s. c  o  m

}