GregorianCalendar getMinimum() Method in Java
The java.util.GregorianCalendar.getMinimum() method is an in-built function in Java which returns the minimum value for the particular calendar field passed as parameter to the function. For any possible time value, it is the smallest value that the get() method returns, considering the current values of the getFirstDayOfWeek(), getMinimalDaysInFirstWeek(), getGregorianChange() and getTimeZone() methods as well.
public int getMinimum(int calendarfield)
Parameters: This function accepts one mandatory parameter calendarfield of integer type whose minimum value for this GregorianCalender instance will be returned by the function.
This method returns the minimum value for the specified calendar field for this GregorianCalender instance.
Input : DAY_OF_MONTH Output : 1 Input : WEEK_OF_MONTH Output : 0
Below programs illustrate the use of java.util.GregorianCalendar.getMinimum() function:
Current Date and Time : Fri Jul 27 11:40:24 UTC 2018 Minimum for WEEK_OF_MONTH field :0 Minimum for DAY_OF_MONTH field:1
Current Date and Time : Fri Jul 27 11:40:28 UTC 2018 Minimum for YEAR field :1 Minimum for HOUR_OF_DAY field :0
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.