Example usage for java.time OffsetDateTime plusYears

List of usage examples for java.time OffsetDateTime plusYears

Introduction

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

Prototype

public OffsetDateTime plusYears(long years) 

Source Link

Document

Returns a copy of this OffsetDateTime with the specified number of years added.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.plusYears(20);
    System.out.println(d);//from  ww  w. j  a  v  a 2 s.co  m
}