Example usage for java.time Duration subtractFrom

List of usage examples for java.time Duration subtractFrom

Introduction

In this page you can find the example usage for java.time Duration subtractFrom.

Prototype

@Override
public Temporal subtractFrom(Temporal temporal) 

Source Link

Document

Subtracts this duration from the specified temporal object.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.ofDays(2);
    Temporal l = duration.subtractFrom(LocalDateTime.now());

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