Calendar.getLeastMaximum()

Calendar.getLeastMaximum(field)Minimum of maximum possible value of the input field .

field : field for which the least maximum possible value is required, Example : DAY_OF_MONTH


Returns the least maximum value .

Sample script with output is here.
package my_proj;
 
import java.util.Calendar;
 
public class my_first {
public static void main(String[] args) {
Calendar my_cal = Calendar.getInstance();// created calendar

System.out.println(my_cal.getLeastMaximum(Calendar.DAY_OF_WEEK));//7
System.out.println(my_cal.getLeastMaximum(Calendar.DAY_OF_MONTH));//28
System.out.println(my_cal.getLeastMaximum(Calendar.DAY_OF_YEAR));//355
}
}
Here is the code to get YEAR and MONTH ( with output )
System.out.println( my_cal.getLeastMaximum(Calendar.MONTH));//11
System.out.println( my_cal.getLeastMaximum(Calendar.YEAR));//292269054
getActualMaximum() Date & time tutorials


Java


plus2net.com






We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer