The toNanoOfDay() method of LocalTime class is used to return the time as nanos of day from this LocalTime.Value returned by this method lie between 0 to 24 * 60 * 60 * 1, 000, 000, 000 – 1.
public long toNanoOfDay()
Parameters: This method accepts no parameters.
Return value: This method returns a the long value which is the nano of day value and is equivalent to this time.
Below programs illustrate the toNanoOfDay() method:
Nano of day: 70490630000000
Nano of day: 84105980000000
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.