day Of Month
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
}