Example usage for java.time OffsetDateTime plus

List of usage examples for java.time OffsetDateTime plus

Introduction

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

Prototype

@Override
public OffsetDateTime plus(TemporalAmount amountToAdd) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.plus(Period.ofDays(2));
    System.out.println(d);// w  w w .j  a  va 2s.com
}