Java Calendar getTime() MethodThe getTime() method of java.util.Calendar class is a final method. This method gets the time value of calendar object and returns the date. SyntaxParameterNo parameter is passed. ReturnsReturns a date which represents time value of calendar object. ThrowsDoes not throw exception. Example 1Test it NowOutput: Date :Sat Nov 23 00:00:00 PST 1996 new Date is :Mon Jan 25 00:00:00 PST 1999 Example 2Test it NowOutput: Date :Wed Aug 08 21:33:33 PDT 2018 new Date is :Mon Oct 07 21:33:33 PDT 1996
Next TopicJava Calendar Class
|