Java .getMinimum()
Published Sep 17, 2023
Contribute to Docs
The .getMinimum() method of the Calendar class returns the minimum value for the given calendar field.
Syntax
calendar.getMinimum(field)
Where the field parameter is the calendar field, for example Calendar.HOUR_OF_DAY.
Example
In the following example, .getMinimum() returns the minimum value for the Calendar.DAY_OF_WEEK field.
import java.util.Calendar;public class Main {public static void main(String[] args) {Calendar calendar = Calendar.getInstance();System.out.println(calendar.getMinimum(Calendar.DAY_OF_WEEK));}}
Output for the above code will be:
1
Contribute to Docs
- 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.
Learn Java on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn to code in Java — a robust programming language used to create software, web and mobile apps, and more.
- Beginner Friendly.17 hours