LocalTime ofNanoOfDay(long nanoOfDay) example
Description
LocalTime ofNanoOfDay(long nanoOfDay)
gets an instance of
LocalTime from a nanos-of-day value.
Syntax
ofNanoOfDay
has the following syntax.
public static LocalTime ofNanoOfDay(long nanoOfDay)
Example
The following example shows how to use ofNanoOfDay
.
import java.time.LocalTime;
// ww w. j a va 2 s . c o m
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.ofNanoOfDay(123123);
System.out.println(l);
}
}
The code above generates the following result.