.getActualMinimum()
Anonymous contributor
Anonymous contributor1 total contribution
Anonymous contributor
Published Sep 27, 2023
Contribute to Docs
The .getActualMinimum()
method returns the minimum value allowed for a given calendar field.
Syntax
min = cal.getActualMinimum(field);
Where myCalendar
is a Calendar
object, and field
is the constant for which the minimum will be returned.
Example
The below example uses .getActualMinimum()
to retrieve the minimum value for a year and the minimum value for a month.
import java.util.Calendar;public class CalendarDemo {public static void main(String[] args) {// Create a calendarCalendar cal = Calendar.getInstance();// Return the minimum value that the year field could haveint a = cal.getActualMinimum(Calendar.YEAR);System.out.println("Minimum year: " + a);// Return the minimum value that the month field could haveint i = cal.getActualMinimum(Calendar.MONTH);System.out.println("Minimum month: " + i);}}
The output from the snippet above would look like this:
Minimum year: 1Minimum month: 0
All contributors
- Anonymous contributorAnonymous contributor1 total contribution
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.