dayOfMonth

actual val dayOfMonth: Int(source)
expect val dayOfMonth: Int(source)

Returns the day-of-month (1..31) component of the date.

Samples

import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlin.random.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   // Getting the day of the month
for (dayOfMonth in 1..30) {
    check(LocalDate(2024, Month.APRIL, dayOfMonth).dayOfMonth == dayOfMonth)
} 
   //sampleEnd
}
actual val dayOfMonth: Int(source)
actual val dayOfMonth: Int(source)