- java.time - Discussion
- java.time - Month
- java.time - ZoneOffset
- java.time - ZoneId
- java.time - ZonedDateTime
- java.time - YearMonth
- java.time - Year
- java.time - Period
- java.time - OffsetTime
- java.time - OffsetDateTime
- java.time - MonthDay
- java.time - LocalTime
- java.time - LocalDateTime
- java.time - LocalDate
- java.time - Instant
- java.time - Duration
- java.time - Clock
- java.time - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
java.time.Month Enum
Introduction
The java.time.Month Enum represents a month-of-year, such as July .
Class declaration
Following is the declaration for java.time.Month Enum −
pubpc enum Month extends Enum<Month> implements TemporalAccessor, TemporalAdjuster
Enum Constants
Following are the fields for Java.time.Month Enum −
JANUARY − The singleton instance for the month of January with 31 days.
FEBRUARY − The singleton instance for the month of February with 28 days, or 29 in a leap year.
MARCH − The singleton instance for the month of March with 31 days.
APRIL − The singleton instance for the month of April with 30 days.
MAY − The singleton instance for the month of May with 31 days.
JUNE − The singleton instance for the month of June with 30 days.
JULY − The singleton instance for the month of July with 31 days.
AUGUST − The singleton instance for the month of August with 31 days.
SEPTEMBER − The singleton instance for the month of September with 30 days.
OCTOBER − The singleton instance for the month of October with 31 days.
NOVEMBER − The singleton instance for the month of November with 30 days.
DECEMBER − The singleton instance for the month of December with 31 days.
Enum methods
Sr.No. | Method & Description |
---|---|
1 | Adjusts the specified temporal object to have the same month-of-year as this object. |
2 | Gets the day-of-year corresponding to the first day of this month. |
3 | Gets the month corresponding to the first month of this quarter. |
4 | Obtains an instance of Month from a temporal object. |
5 | Gets the value of the specified field from this month-of-year as an int. |
6 | Gets the textual representation, such as Jan or December . |
7 | Gets the value of the specified field from this month-of-year as a long. |
8 | Gets the month-of-year int value. |
9 | Checks if the specified field is supported. |
10 | Gets the length of this month in days. |
11 | Gets the maximum length of this month in days. |
12 | Gets the minimum length of this month in days. |
13 | Returns the month-of-year that is the specified number of months before this one. |
14 | Obtains an instance of Month from an int value. |
15 | Returns the month-of-year that is the specified number of quarters after this one. |
16 | Queries this offset using the specified query. |
17 | Gets the range of vapd values for the specified field. |
18 | Returns the enum constant of this type with the specified name. |
19 | Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited
This class inherits methods from the following classes −
Java.lang.Enum
Java.lang.Object