Example usage for java.time.temporal Temporal plus

List of usage examples for java.time.temporal Temporal plus

Introduction

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

Prototype

default Temporal plus(TemporalAmount amount) 

Source Link

Document

Returns an object of the same type as this object with an amount added.

Usage

From source file:Main.java

public static void main(String[] args) {
    TemporalAdjuster temporalAdjuster = (Temporal t) -> t.plus(Period.ofDays(10));

    System.out.println(temporalAdjuster);

    TemporalAdjuster fourMinutesFromNow = temporal -> temporal.plus(4, ChronoUnit.MINUTES);

    LocalTime localTime1 = LocalTime.of(12, 0, 0);
    System.out.println(localTime1.with(temporal -> temporal.plus(4, ChronoUnit.MINUTES)));

    System.out.println(Instant.now().with(temporalAdjuster));

    LocalDate localDate1 = LocalDate.of(2013, 12, 13);
    System.out.println(localDate1.with(TemporalAdjusters.lastDayOfMonth()));

}