LocalTime plusNanos(long nanosToAdd) example
Description
LocalTime plusNanos(long nanosToAdd)
returns a copy of this LocalTime with the specified period in nanoseconds added.
Syntax
plusNanos
has the following syntax.
public LocalTime plusNanos(long nanosToAdd)
Example
The following example shows how to use plusNanos
.
import java.time.LocalTime;
/*w w w . j a va 2 s. co m*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.plusNanos(1234);
System.out.println(s);
}
}
The code above generates the following result.