Example usage for java.time LocalDateTime withMonth

List of usage examples for java.time LocalDateTime withMonth

Introduction

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

Prototype

public LocalDateTime withMonth(int month) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01);

    LocalDateTime t = a.withMonth(2);

    System.out.println(t);/*ww w  . j  ava  2  s  .  c  om*/
}