Skip to content

//core/io.islandtime/weekOfYear

weekOfYear

common

fun Date.weekOfYear(settings: WeekSettings): Int

fun DateTime.weekOfYear(settings: WeekSettings): Int

fun OffsetDateTime.weekOfYear(settings: WeekSettings): Int

fun ZonedDateTime.weekOfYear(settings: WeekSettings): Int

The week of the year, calculated using the week definition in settings. If the week number is associated with the preceding year, 0 will be returned.

To obtain the week number of the week-based year, use weekOfWeekBasedYear instead.

See also

weekOfWeekBasedYear

common

fun Date.weekOfYear(locale: Locale): Int

fun DateTime.weekOfYear(locale: Locale): Int

fun OffsetDateTime.weekOfYear(locale: Locale): Int

fun ZonedDateTime.weekOfYear(locale: Locale): Int

The week of the year, calculated using the week definition associated with the provided locale. If the week number is associated with the preceding year, 0 will be returned.

To obtain the week number of the week-based year, use weekOfWeekBasedYear instead.

Keep in mind that the system's calendar settings may differ from that of the default locale on some platforms. To respect the system calendar settings, use WeekSettings.systemDefault instead.

See also

weekOfWeekBasedYear

common

val Date.weekOfYear: Int

val DateTime.weekOfYear: Int

val OffsetDateTime.weekOfYear: Int

val ZonedDateTime.weekOfYear: Int

The week of the year, calculated using the ISO week definition. If the week number is associated with the preceding year, 0 will be returned.

To obtain the week number used in the ISO week date system, use weekOfWeekBasedYear instead.

See also

weekOfWeekBasedYear