Calendar.getLeastMaximum()

Date

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


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here




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