Example usage for java.time Instant adjustInto

List of usage examples for java.time Instant adjustInto

Introduction

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

Prototype

@Override
public Temporal adjustInto(Temporal temporal) 

Source Link

Document

Adjusts the specified temporal object to have this instant.

Usage

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");

    Temporal t = instant.adjustInto(Instant.now());
    System.out.println(t);/*  ww w  .j  a  v a  2 s. com*/

}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    ZonedDateTime l = ZonedDateTime.now();
    Temporal t = instant.adjustInto(l);
    System.out.println((ZonedDateTime) t);

}