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




Latest Courses