Home >Database >Mysql Tutorial >How to use WEEKDAY in MySQL
WEEKDAY(date)
SELECT WEEKDAY(‘2016-01-16') SELECT WEEKDAY(‘2016-01-16 00:00:00')
-> 5 (表示返回date是在一周中的序号,西方日历中通常一周的开始是星期天,并且以0开始计数,所以,记住:0=星期一,1=星期二, ... 5=星期六)
The above is the detailed content of How to use WEEKDAY in MySQL. For more information, please follow other related articles on the PHP Chinese website!