month

actual val month: Month(source)
expect val month: Month(source)

Returns the month (Month) component of the date.

Samples

import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlin.random.*
import kotlin.test.*
fun main() { 
   //sampleStart 
   // Getting the month
for (month in Month.entries) {
    check(LocalDate(2024, month, 16).month == month)
} 
   //sampleEnd
}
actual val month: Month(source)
actual val month: Month(source)