Example usage for java.time LocalDateTime withYear

List of usage examples for java.time LocalDateTime withYear

Introduction

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

Prototype

public LocalDateTime withYear(int year) 

Source Link

Document

Returns a copy of this LocalDateTime with the 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.withYear(2012);

    System.out.println(t);/* w ww  .  j a  v a  2  s  .c  o m*/
}