Example usage for java.time Month plus

List of usage examples for java.time Month plus

Introduction

In this page you can find the example usage for java.time Month plus.

Prototype

public Month plus(long months) 

Source Link

Document

Returns the month-of-year that is the specified number of months after this one.

Usage

From source file:Main.java

public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());

    System.out.println(m.plus(8));

}

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, Month.AUGUST, 3);
    System.out.println(localDate);
    Month month1 = Month.from(localDate);
    System.out.println(month1);//from  w ww  . j  a v  a 2  s.com

    Month month2 = Month.of(2);
    System.out.println(month2);

    Month month3 = month2.plus(2);
    System.out.println(month3);

    Month month4 = localDate.getMonth();
    System.out.println(month4);

    int monthIntValue = month2.getValue();
    System.out.println(monthIntValue);
}