Java Timestamp toString() MethodThe toString() method of Timestamp class converts the Timespan object in JDBC timestamp escape format. SyntaxParametersNA ReturnsThe toString () method of Timestamp class returns a string object in JDBC timestamp escape format . OverridesThe toString () method of Timestamp class overrides: toString () method in class Date Example 1Test it NowOutput: Timestamp : 2018-09-01 09:01:15.0 New Timespan : 2018-09-01 09:01:15.0 Example 2Test it NowOutput: Timestamp : 2018-09-06 11:13:07.556 Current New Timespan : 2018-09-06 11:13:07.556
Next TopicJava Timestamp
|