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.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset