Java Timestamp compareTo() MethodThe compareTo () method of Timestamp class compares this Timestamp object to the given Timestamp object or to the given date object. SyntaxParameters
ReturnsThe compareTo() method of Timestamp class returns :
Example 1Test it NowOutput: TimeSpan2 value is greater Example 2Test it NowOutput: Geetanjali's birthTime is greater than Reema Example 3Test it NowOutput: Expire Timespan: 2018-09-03 09:01:15.0 Today date: Sun Sep 02 20:27:12 IST 2018 Your plan has not expired. You can still avail our facility.
Next TopicJava Timestamp
|