Example usage for java.time OffsetDateTime withMonth

List of usage examples for java.time OffsetDateTime withMonth

Introduction

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

Prototype

public OffsetDateTime withMonth(int month) 

Source Link

Document

Returns a copy of this OffsetDateTime with the month-of-year altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withMonth(3);
    System.out.println(d);//w  ww.  j a va2 s  . c om
}