Java Date Time - LocalTime ofNanoOfDay(long nanoOfDay) example








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;

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.