Example usage for java.util GregorianCalendar getGreatestMinimum

List of usage examples for java.util GregorianCalendar getGreatestMinimum

Introduction

In this page you can find the example usage for java.util GregorianCalendar getGreatestMinimum.

Prototype

@Override
public int getGreatestMinimum(int field) 

Source Link

Document

Returns the highest minimum value for the given calendar field of this GregorianCalendar instance.

Usage

From source file:Main.java

public static void main(String[] args) {

    GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();

    // get greatest minimum for day_of_month
    int min = cal.getGreatestMinimum(GregorianCalendar.DAY_OF_MONTH);
    System.out.println("Greatest Minimum:" + min);

    // get greatest minimum for YEAR
    min = cal.getGreatestMinimum(GregorianCalendar.YEAR);
    System.out.println("Greatest Minimum:" + min);

}