Example usage for java.time Duration minusNanos

List of usage examples for java.time Duration minusNanos

Introduction

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

Prototype

public Duration minusNanos(long nanosToSubtract) 

Source Link

Document

Returns a copy of this duration with the specified duration in nanoseconds subtracted.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getNano());
    duration = duration.minusNanos(3);
    System.out.println(duration.getNano());

}