Example usage for java.time ZonedDateTime plusYears

List of usage examples for java.time ZonedDateTime plusYears

Introduction

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

Prototype

public ZonedDateTime plusYears(long years) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime n = dateTime.plusYears(12);
    System.out.println(n);/* w  w w .  j  a  va  2s  .  c  o  m*/
}