Example usage for java.time LocalDate plus

List of usage examples for java.time LocalDate plus

Introduction

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

Prototype

@Override
public LocalDate plus(TemporalAmount amountToAdd) 

Source Link

Document

Returns a copy of this date with the specified amount added.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = a.plus(Period.ofDays(100));
    System.out.println(b);/*  w w w.j ava 2  s  .c  o  m*/
}

From source file:Main.java

public static void main(String[] args) {
    Period twoMonthsAndFiveDays = Period.ofMonths(2).plusDays(5);
    LocalDate sixthOfJanuary = LocalDate.of(2014, 1, 6);

    LocalDate eleventhOfMarch = sixthOfJanuary.plus(twoMonthsAndFiveDays);

    System.out.println(eleventhOfMarch);
}