Java Calendar after() MethodThis method returns true if the time represented by this Calendar is after the time represented by when Object. If it is not the case, false is returned. SyntaxParameterWhen - the Object of time that is about to be compared. ReturnsTrue if the time represented by this Calendar is after the time represented by when Object; false otherwise. Example 1Output: Current date: Sun Jul 29 07:50:47 PDT 2018 Year is 2015 Date Wed Jul 29 07:50:47 PDT 2015 is before current date. Example 2Output: Current date: Sun Jul 29 07:52:17 PDT 2018 Year is 10 Date Thu Nov 29 07:52:17 PST 2018 is after current date. Example 3Output: Current date: Sun Jul 29 07:53:23 PDT 2018 Year is 30 Date Mon Jul 30 07:53:23 PDT 2018 is after current date. Example 4Output: Output Current date: Sun Jul 29 07:54:14 PDT 2018 Now date is Mon Jul 30 06:54:14 PDT 2018 Now date is Mon Jul 30 07:00:14 PDT 2018 Now date is Mon Jul 30 07:00:30 PDT 2018 Date Mon Jul 30 07:00:30 PDT 2018 is after current date. Next TopicJava-calendar-before-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