HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
MySQL Functions : Return the week number for a date
The WEEK() function returns the week number for a given date (a number from 0 to 53).
WEEK(date, firstdayofweek)
Parameter | Description |
---|---|
date | Required. The date or datetime to extract the week number form |
firstdayofweek |
Optional. Specifies what day the week starts on. Can be one of the following:
|
Works in: | From MySQL 4.0 |
---|
Return the week number for a date:
SELECT WEEK("2017-10-25");
Return the week number for the current system date:
SELECT WEEK(CURDATE());