numberOfDays

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

Returns the number of days in the year-month.

Samples

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

fun main() { 
   //sampleStart 
   // Determining the number of days in a year-month
check(YearMonth(2024, Month.FEBRUARY).numberOfDays == 29)
check(YearMonth(2023, Month.FEBRUARY).numberOfDays == 28)
check(YearMonth(2024, Month.APRIL).numberOfDays == 30) 
   //sampleEnd
}
actual val numberOfDays: Int(source)