YEAROFWEEK
Description
The YEAROFWEEK function is used to return the ISO week-numbered year corresponding to a given date (expr). The ISO week-numbered year is calculated according to the international standard ISO 8601, which sets the first day of each week as Monday.
Parameter Description
- expr: The input date or timestamp, of type date or timestamp_ltz.
Return Result
Returns an integer value representing the ISO week-numbered year of the given date.
Example
- Get the ISO week-numbered year based on the current time:
- Calculate the ISO week number year for a specified date:
- Calculate the ISO week number year for a given timestamp:
- Calculate and compare the ISO week number years of two different dates: