Month

A month of the year.

enum Month : Enum<Month>

Entries

JANUARY
Link copied to clipboard
common
FEBRUARY
Link copied to clipboard
common
MARCH
Link copied to clipboard
common
APRIL
Link copied to clipboard
common
MAY
Link copied to clipboard
common
MAY()
JUNE
Link copied to clipboard
common
JULY
Link copied to clipboard
common
AUGUST
Link copied to clipboard
common
SEPTEMBER
Link copied to clipboard
common
OCTOBER
Link copied to clipboard
common
NOVEMBER
Link copied to clipboard
common
DECEMBER
Link copied to clipboard
common

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
operator override fun compareTo(other: Month): Int
dayRangeIn
Link copied to clipboard
common

Returns the range of valid days for this month within a given year

fun dayRangeIn(year: Int): IntRange
displayName
Link copied to clipboard
common

A textual representation of the month, suitable for display purposes. The localized name will be returned, if available. If not, the ISO month number (1-12) will be returned instead.

The result depends on the configured DateTimeTextProvider and may differ between platforms.

fun displayName(style: TextStyle, locale: Locale): String
equals
Link copied to clipboard
common
operator override fun equals(other: Any?): Boolean
firstDayOfYearIn
Link copied to clipboard
common

Returns the day of the year that this month's first days falls on. This may vary depending on whether or not the year is a leap year. For example, the first day of MARCH will be either 60th or 61st day of the year.

fun firstDayOfYearIn(year: Int): Int
hashCode
Link copied to clipboard
common
override fun hashCode(): Int
lastDayIn
Link copied to clipboard
common

Returns the last day of the month in a particular year.

fun lastDayIn(year: Int): Int
lastDayOfYearIn
Link copied to clipboard
common

Returns the day of the year that this month's last day falls on. This may vary depending on whether or not the year is a leap year. For example, the last of FEBRUARY will be either 59th or 60th day of the year.

fun lastDayOfYearIn(year: Int): Int
lengthIn
Link copied to clipboard
common

Returns the number of days in the month for a particular year.

fun lengthIn(year: Int): IntDays
localizedName
Link copied to clipboard
common

The localized name of the month, if available for the locale in the specified style. The result depends on the configured DateTimeTextProvider and may differ between platforms.

fun localizedName(style: TextStyle, locale: Locale): String?
minus
Link copied to clipboard
common

Subtracts months from this month, wrapping when the beginning or end of the year is reached.

operator fun minus(months: IntMonths): Month
operator fun minus(months: LongMonths): Month
plus
Link copied to clipboard
common

Adds months to this month, wrapping when the beginning or end of the year is reached.

operator fun plus(months: IntMonths): Month
operator fun plus(months: LongMonths): Month
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

firstDayOfCommonYear
Link copied to clipboard
common

The day of the year corresponding to the month's first day in a common year.

For example, the first day of MARCH is the 60th day of a common year.

abstract val firstDayOfCommonYear: Int
firstDayOfLeapYear
Link copied to clipboard
common

The day of the year corresponding to the month's first day in a leap year.

For example, the first day of MARCH is the 61st day of a leap year.

val firstDayOfLeapYear: Int
lengthInCommonYear
Link copied to clipboard
common

The number of days in the month in a common year.

abstract val lengthInCommonYear: IntDays
lengthInLeapYear
Link copied to clipboard
common

The number of days in the month in a leap month.

open val lengthInLeapYear: IntDays
name
Link copied to clipboard
common
override val name: String
number
Link copied to clipboard
common

The ISO month number, from 1-12.

val number: Int
ordinal
Link copied to clipboard
common
override val ordinal: Int