Java Timestamp toInstant() MethodThe toInstant() method of Timestamp class coverts the Timespan object to an Instant which represents the same point on the time-line as this Timestamp. SyntaxParametersNA ReturnsThe toInstant () method of Timestamp class returns an Instant which represents the same point on the time-line as this Timestamp. OverridesThe toInstant () method of Timestamp class overrides: toInstant () method in class Date Example 1Output: Timestamp : 2018-09-01 09:01:15.0 Instant Timespan : 2018-09-01T03:31:15Z Example 2Output: Timestamp : 2018-09-06 11:59:02.683 Current instant Timespan : 2018-09-06T06:29:02.683Z Next TopicJava-timestamp-tolocaldatetime-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India