Javatpoint Logo
Javatpoint Logo

Java Timestamp getNanos() Method

The getNanos() method of Timestamp class fetches the Timestamp object's nanos value .

Syntax

Parameters

NA

Returns

The getNanos() method of Timestamp class returns this Timestamp object?s nanos value.

Example 1

Test it Now

Output:

Timestamp : 2018-09-01 09:01:15.0
Fractional seconds component : 0

Example 2

Test it Now

Output:

Timestamp : 2018-09-01 09:01:15.45
Fractional seconds component : 450000000
Next TopicJava Timestamp




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials