get week of the year kotlinm

import java.text.SimpleDateFormat
import java.util.*

fun main() {
    // Step 1: Create a SimpleDateFormat object with the desired date format
    val dateFormat = SimpleDateFormat("yyyy-MM-dd")

    // Step 2: Get the current date as a string
    val currentDate = dateFormat.format(Date())

    // Step 3: Parse the current date string to a Date object
    val date = dateFormat.parse(currentDate)

    // Step 4: Create a Calendar instance and set it to the parsed date
    val calendar = Calendar.getInstance()
    calendar.time = date

    // Step 5: Get the week of the year from the Calendar instance
    val weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR)

    // Step 6: Print the result
    println("Week of the year: $weekOfYear")
}