weekOfYear

Syntax

weekOfYear(X)

Arguments

X is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.

Details

Return the week number for X.

Note:

  • Each week starts on Sunday. The first week of the year has more than 4 days.

  • If 31 December is on a Monday, Tuesday or Wednesday, it is in week 01 of the next year. If it is on a Thursday, it is in week 53 of the year just ending; if on a Friday it is in week 52 (or 53 if the year just ending is a leap year); if on a Saturday or Sunday, it is in week 52 of the year just ending.