Example usage for java.time OffsetDateTime withYear

List of usage examples for java.time OffsetDateTime withYear

Introduction

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

Prototype

public OffsetDateTime withYear(int year) 

Source Link

Document

Returns a copy of this OffsetDateTime with the year altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withYear(2010);
    System.out.println(d);//from w  w  w . j  av a  2s . c om
}