Returns a copy of this LocalTime with the specified number of nanoseconds subtracted, adjusting other fields if necessary.
package com.logicbig.example.localtime;
import java.time.LocalTime;
public class MinusNanosExample {
public static void main (String... args) {
LocalTime d1 = LocalTime.of(12, 30, 50, 100000);
System.out.println(d1);
LocalTime d2 = d1.minusNanos(5000);
System.out.println(d2);
d2 = d1.minusNanos(-5000);
System.out.println(d2);
}
}
Output
12:30:50.000100
12:30:50.000095
12:30:50.000105