Java Date Time - Java Calendar.getActualMinimum(int field)








Syntax

Calendar.getActualMinimum(int field) has the following syntax.

public int getActualMinimum(int field)

Example

In the following code shows how to use Calendar.getActualMinimum(int field) method.

//from  ww w.j  ava2  s. co  m

import java.util.Calendar;

public class Main {

   public static void main(String[] args) {
      
      Calendar cal = Calendar.getInstance();

      // return the minimum value that the year field could have
      int i = cal.getActualMinimum(Calendar.YEAR);
      System.out.println("Minimum Year :"+ i);
      
      // returns the minimum value that the month field could have
      int a = cal.getActualMinimum(Calendar.MONTH);
      System.out.println("Minimum month :"+ a);
   }
}

The code above generates the following result.