Returns a copy of this instant with the specified duration in nanoseconds added.
package com.logicbig.example.instant;
import java.time.Instant;
public class PlusNanosExample {
public static void main(String... args) {
Instant i = Instant.now();
System.out.println(i);
Instant i2 = i.plusNanos(1000000);
System.out.println(i2);
Instant i3 = i.plusNanos(-1000000);
System.out.println(i3);
}
}
Output
2017-05-01T20:57:16.073Z
2017-05-01T20:57:16.074Z
2017-05-01T20:57:16.072Z