week

Return the week

Syntax

week(dt_expr)

Arguments

dt_expr A date expression.

Arguments

This function returns the number of the week of the year in the specified date expression as a number between 1 and 53.

The data type DATE assumes the Gregorian calendar even for dates prior to the introduction of the Gregorian calendar. This means that databases that store historical dates prior to the introduction of the Gregorian calendar may not compute SELECT with date ranges, DAYOFWEEK, and WEEK correctly.

Example

select week(curdate()) as "Current Week";

Current Week
          16