java.util.Calendar getActualMinimum(int field)

Description :

This java tutorial shows how to use the getActualMinimum(int field) method of Calendar class of java.util package. Returns the minimum value that the specified calendar field could have, given the time value of this Calendar.

Method Syntax :

public int getActualMinimum(int field)

Parameter Input :

 

DataType Parameter Description
int field the calendar field we want to get the actual minimum value

 

Method Returns :

This method returns int which corresponds to the minimum of the given calendar field for the time value of this Calendar.

Compatibility Version :

Requires Java 1.2 and up

Exception :

N/A

Java Code Example :

This java example source code demonstrates the use of getActualMinimum(int field) method of Calendar class. This example java code simply prints the actual minimum values for some of the Calendar fields.

package com.javatutorialhq.java.examples;

import java.util.Calendar;

/*
 * This example source code demonstrates the use of  
 * getActualMinimum(int field) of Calendar class
 */

public class CalendarGetActualMinimumExample {

	public static void main(String[] args){

		Calendar cal = Calendar.getInstance();
		System.out.println("Time:" + cal.getTime());		
		int ActualMinYear = cal.getActualMinimum(Calendar.YEAR);
		int ActualMinMonth = cal.getActualMinimum(Calendar.MONTH);
		int ActualMinWeek = cal.getActualMinimum(Calendar.WEEK_OF_YEAR);
		int ActualMinDate = cal.getActualMinimum(Calendar.DATE);
		
		System.out.println("Actual Minimum Year:"+ActualMinYear);
		System.out.println("Least MaxmimumMonth:"+ActualMinMonth);
		System.out.println("Least MaxmimumWeek of Year:"+ActualMinWeek);
		System.out.println("Least MaxmimumDate:"+ActualMinDate);
		
	}
}

Sample Output :

Running the getActualMinimum(int field) method example source code of Calendar class will give you the following output:

Time:Thu Feb 12 22:37:59 CST 2015
Actual Minimum Year:1
Least MaxmimumMonth:0
Least MaxmimumWeek of Year:1
Least MaxmimumDate:1

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :