Example usage for java.time LocalDate with

List of usage examples for java.time LocalDate with

Introduction

In this page you can find the example usage for java.time LocalDate with.

Prototype

@Override
public LocalDate with(TemporalField field, long newValue) 

Source Link

Document

Returns a copy of this date with the specified field set to a new value.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    LocalDate b = a.with(ChronoField.YEAR, 2015);
    System.out.println(b);//from   w w w  .  j  a v  a 2s  .  c  om
}