Skip to main content

weekofyear

Description

Returns the week number for a given date within a year.

The date parameter must be of the DATE or DATETIME type.

Syntax

INT WEEKOFYEAR(DATETIME date)

Examples

MySQL > select weekofyear('2008-02-20 00:00:00');
+-----------------------------------+
| weekofyear('2008-02-20 00:00:00') |
+-----------------------------------+
| 8 |
+-----------------------------------+

keyword

WEEKOFYEAR