Javatpoint Logo
Javatpoint Logo

Java Date toInstant() Method

The toInstant() method of Java Date class converts this date object into an Instant, and it returns an instant representing the same point on the tim-line as the date object.

Syntax:

Parameters

NA

Return

It returns an instant representing the same point on time-line as the date object.

Example

Test it Now

Output:

date in Instant : 2018-09-25T04:48:26.617Z

Next TopicJava Util Date





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