isoWeekNumber
The ISO week number within the week year.
Note that this value is unsuitable for finding the week number within the calendar year, as the normal and the ISO week years can be different for the same date. For example, 2010-01-01 has the isoWeekNumber equal to 53, since the corresponding ISO week date is 2009-W53-5.
Has the range of 1 to 52 or 53, depending on the year.
Samples
import kotlinx.datetime.*
import kotlin.test.*
fun main() {
//sampleStart
// The ISO week number of a LocalIsoWeekDate corresponding to the date 2005-01-01
check(53 == LocalDate(2005, 1, 1).toLocalIsoWeekDate().isoWeekNumber)
//sampleEnd
}Content copied to clipboard