Example usage for java.time Duration addTo

List of usage examples for java.time Duration addTo

Introduction

In this page you can find the example usage for java.time Duration addTo.

Prototype

@Override
public Temporal addTo(Temporal temporal) 

Source Link

Document

Adds this duration to the specified temporal object.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.ofDays(2);
    Temporal l = duration.addTo(LocalDateTime.now());

    System.out.println(l);//from   www.ja v a  2s  . c o m

}