Returns a copy of this LocalTime with the specified number of nano-seconds added.
package com.logicbig.example.localtime;
import java.time.LocalTime;
public class PlusNanosExample {
public static void main (String... args) {
LocalTime t = LocalTime.of(10, 2, 20);
System.out.println(t);
LocalTime t2 = t.plusNanos(20000);
System.out.println(t2);
t2 = t.plusNanos(-20000);
System.out.println(t2);
}
}
Output
10:02:20
10:02:20.000020
10:02:19.999980