Example usage for java.time LocalDateTime adjustInto

List of usage examples for java.time LocalDateTime adjustInto

Introduction

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

Prototype

@Override 
public Temporal adjustInto(Temporal temporal) 

Source Link

Document

Adjusts the specified temporal object to have the same date and time as this object.

Usage

From source file:Main.java

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

    Temporal t = a.adjustInto(b);

    System.out.println(t);//from  w ww .jav  a  2 s.  c o m
}