object Month extends Serializable
A month-of-year, such as 'July'.
Month
is an enum representing the 12 months of the year - January, February, March,
April, May, June, July, August, September, October, November and December.
In addition to the textual enum name, each month-of-year has an int
value. The
int
value follows normal usage and the ISO-8601 standard, from 1 (January) to 12 (December). It
is recommended that applications use the enum rather than the int
value to ensure code
clarity.
Do not use ordinal()
to obtain the numeric representation of Month
. Use
getValue()
instead.
This enum represents a common concept that is found in many calendar systems. As such, this enum may be used by any calendar system that has the month-of-year concept defined exactly equivalent to the ISO-8601 calendar system.
Specification for implementors
This is an immutable and thread-safe enum.
- Alphabetic
- By Inheritance
- Month
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
lazy val
APRIL: Month
The singleton instance for the month of April with 30 days.
The singleton instance for the month of April with 30 days. This has the numeric value of
4
. -
lazy val
AUGUST: Month
The singleton instance for the month of August with 31 days.
The singleton instance for the month of August with 31 days. This has the numeric value of
8
. -
lazy val
DECEMBER: Month
The singleton instance for the month of December with 31 days.
The singleton instance for the month of December with 31 days. This has the numeric value of
12
. -
lazy val
FEBRUARY: Month
The singleton instance for the month of February with 28 days, or 29 in a leap year.
The singleton instance for the month of February with 28 days, or 29 in a leap year. This has the numeric value of
2
. -
lazy val
JANUARY: Month
The singleton instance for the month of January with 31 days.
The singleton instance for the month of January with 31 days. This has the numeric value of
1
. -
lazy val
JULY: Month
The singleton instance for the month of July with 31 days.
The singleton instance for the month of July with 31 days. This has the numeric value of
7
. -
lazy val
JUNE: Month
The singleton instance for the month of June with 30 days.
The singleton instance for the month of June with 30 days. This has the numeric value of
6
. -
lazy val
MARCH: Month
The singleton instance for the month of March with 31 days.
The singleton instance for the month of March with 31 days. This has the numeric value of
3
. -
lazy val
MAY: Month
The singleton instance for the month of May with 31 days.
The singleton instance for the month of May with 31 days. This has the numeric value of
5
. -
lazy val
NOVEMBER: Month
The singleton instance for the month of November with 30 days.
The singleton instance for the month of November with 30 days. This has the numeric value of
11
. -
lazy val
OCTOBER: Month
The singleton instance for the month of October with 31 days.
The singleton instance for the month of October with 31 days. This has the numeric value of
10
. -
lazy val
SEPTEMBER: Month
The singleton instance for the month of September with 30 days.
The singleton instance for the month of September with 30 days. This has the numeric value of
9
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
from(temporal: TemporalAccessor): Month
Obtains an instance of
Month
from a temporal object.Obtains an instance of
Month
from a temporal object.A
TemporalAccessor
represents some form of date and time information. This factory converts the arbitrary temporal object to an instance ofMonth
.The conversion extracts the
MONTH_OF_YEAR
field. The extraction is only permitted if the temporal object has an ISO chronology, or can be converted to aLocalDate
.This method matches the signature of the functional interface
TemporalQuery
allowing it to be used in queries via method reference,Month::from
.- temporal
the temporal object to convert, not null
- returns
the month-of-year, not null
- Exceptions thrown
DateTimeException
if unable to convert to a { @code Month}
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
of(month: Int): Month
Obtains an instance of
Month
from anint
value.Obtains an instance of
Month
from anint
value.Month
is an enum representing the 12 months of the year. This factory allows the enum to be obtained from theint
value. Theint
value follows the ISO-8601 standard, from 1 (January) to 12 (December).- month
the month-of-year to represent, from 1 (January) to 12 (December)
- returns
the month-of-year, not null
- Exceptions thrown
DateTimeException
if the month-of-year is invalid
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def valueOf(v: String): Month
- lazy val values: Array[Month]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()