Java Date Time - LocalDate adjustInto(Temporal temporal) example








LocalDate adjustInto(Temporal temporal) adjusts the specified temporal object to have the same date as this object.

Syntax

adjustInto has the following syntax.

public Temporal adjustInto(Temporal temporal)

Example

The following example shows how to use adjustInto.

import java.time.LocalDate;
import java.time.temporal.Temporal;
/* ww w .  j av  a2s  . c o m*/
public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);
    a.adjustInto(LocalDate.of(2015, 6, 30));
    
  }
}