Java LocalDate add month

Description

Java LocalDate add month

import java.time.LocalDate;
import java.time.Month;

public class Main {
  public static void main(String[] args) {
    LocalDate ld1 = LocalDate.of(2014, Month.JANUARY, 31);
    LocalDate ld2 = ld1.plusMonths(1);
    System.out.println(ld1);//from  w w  w . jav a2  s. c  o m
    System.out.println(ld2);
  }
}



PreviousNext

Related