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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA