Java Calendar after() Method3 Nov 2024 | 3 min read This 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 |
The isSet() method of java.util.Calendar class is a final method which returns the Boolean value. This method checks whether the passed parameter value is set or not. If it is not set, it returns false otherwise true Syntax public final boolean isSet(int field) Parameter field - the calendar field. Returns Returns a...
2 min read
The internalGet() method of java.util.Calendar class is a final, and protected method. This method returns the value of the calendar field passed as a parameter. Syntax protected final int internalGet(int field) Parameter field - the given calendar field. Returns the value for the given calendar field. Throws Does not throw Exception. Example 1 import java.util.GregorianCalendar; public class...
2 min read
The getAvailableLocals() method of java.util.Calendar class returns an array of all locales available in java runtime environment. The array of locales contains locales for which localized Calendar instances are available. getAvailableLocals() method is a static method. Syntax public static Locale[] getAvailableLocales() Parameter This method doesn't accept any parameter. Returns This method...
2 min read
The set() method of Calendar class is used to set the specified calendar field by the specified value. Syntax This method is overloaded in the following ways. public void set(int field, int value) public final void set(int year, int month, int date) public final void set(int year,int month, int date, int...
2 min read
The computeFields() method of java Calendar class is protected and abstract method. It converts the current millisecond time value to calendar field values in fields[].This allows syncing up with the calendar field values with a new time that is set for the calendar object. Syntax protected abstract void...
3 min read
The getFirstDayOfWeek() method of java.util.Calendar.getFirstDayOfWeek() class. It returns first day of week in integer form. i.e. corresponding integer value of DAY Field. No parameter is passed to getFirstDayOfWeek() method. Syntax public int getFirstDayOfWeek() Parameter No parameter is passed. Returns Returns the first day of the week in integer form. Throws Does not throw...
3 min read
//return String The getDisplayName() method of java.util.Calendar class returns String representation of the calendar field value passed as parameter in a given style and local. Style and local are also passed as parameter. If no String representation is available, getDisplayName() returns null value. If String representation...
5 min read
The hashCode() method of java is method of object class and object class is ultimate super class of all classes in java. hashCode() method is overloaded by all other classes in java. This method returns hash code for calendar object. Syntax public int hashCode() Parameter No parameter is passed. Returns A hash...
2 min read
The clone() method is a method of object class and Object class is super class of all the classes of java. clone() method can be called for the object of calendar class also. Clone method returns the copy of the object. Syntax public Object clone() Parameter This method does not...
3 min read
The getGreatestMinimum() method of java.util.Calendar class is an abstract method. This method returns (maximum value out of all minimum values) highest minimum value of Calendar field passed as the parameter. Syntax public abstract int getGreatestMinimum(int field) Parameter field - This method accepts Calendar field as parameter. Returns Returns an integer...
3 min read
We request you to subscribe our newsletter for upcoming updates.
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