.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
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Java
Learn to code in Java — a robust programming language used to create software, web and mobile apps, and more.Beginner Friendly17 hours