Java Instant getNano() method

The getNano() method of Java Instant class is used to get the specific moment on the timeline, from the start of the second.

Syntax

Parameters

No parameters.

Return

The nanoseconds within the second, always positive, never exceeds 999,999,999.

Example 1

Output:

The output will be like this.

520000000

Example 2

Output:

The output will be like this.

0