Топ-100
top of page
Волнистый абстрактный фон
CerebroSQL

WEEK

Database: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Topic

Syntax:
WEEK(date[,mode])

This function returns the week number for date. The two-argument form
of WEEK() enables you to specify whether the week starts on Sunday or
Monday and whether the return value should be in the range from 0 to 53
or from 1 to 53. If the mode argument is omitted, the value of the
default_week_format system variable is used. See
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html.

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Example

mysql> SELECT WEEK('2008-02-20');
-> 7
mysql> SELECT WEEK('2008-02-20',0);
-> 7
mysql> SELECT WEEK('2008-02-20',1);
-> 8
mysql> SELECT WEEK('2008-12-31',1);
-> 53

bottom of page