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(TemporalAmount amountToSubtract) 

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(Period.ofYears(3));
    System.out.println(s);//from w w  w  .  j a  v  a 2s .c o m

}