ID EN
Date and Time Functions

WEEKOFYEAR(date)

MySQL 8.4

Returns the calendar week of the date as a number in the range from 1 to 53. Returns NULL if date is NULL.

Syntax

MYSQL
SELECT WEEKOFYEAR('2008-02-20');
8

Examples

Example

WEEKOFYEAR() is a compatibility function that is equivalent to WEEK(date,3).

MYSQL
SELECT WEEKOFYEAR('2008-02-20');
8