Example usage for java.time OffsetDateTime withDayOfMonth

List of usage examples for java.time OffsetDateTime withDayOfMonth

Introduction

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

Prototype

public OffsetDateTime withDayOfMonth(int dayOfMonth) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withDayOfMonth(1);
    System.out.println(d);/* w  ww  .  j  av a 2s . c o  m*/
}