Example usage for java.time Instant until

List of usage examples for java.time Instant until

Introduction

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

Prototype

@Override
public long until(Temporal endExclusive, TemporalUnit unit) 

Source Link

Document

Calculates the amount of time until another instant in terms of the specified unit.

Usage

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();
    System.out.println(instant.until(l, ChronoUnit.DAYS));

}