The getWeekOfYear() function takes a dateTimeValue as an argument, and returns a number representing the week of the year in which the specified dateTimeValue falls.
1 represents the first week, 2 represents the 2nd week, and so on, with 52 being the final number representing the last week of the year.
|<variable>||Variable which will contain the returned number.||NUMBER|
The date-time value based on which a number will be returned.
The date-time value can be specified without a time value, in which case 00:00:00 will be taken as the default time value.
A runtime error will be encountered if:
The function returns a null value if:
Refer this help document to learn about the supported date-time formats.
weekNumber = currentDate.getWeekOfYear(); // returns 11