Home » Java Date toInstant() Method with Examples

Java Date toInstant() Method with Examples

by Online Tutorials Library

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

You may also like