C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL Date/Time week() FunctionThe week() is a MySQL date/time function. It is used to get the week portion from given date. Syntax
select week(date_value, [mode]); Parameter:
Date_value : date for getting week Mode : it is optional. It is used to specify what day the week starts on. It can be one of the following:
Returns:
This function returns the week portion of a date value. Example 1
select week('2018-10-03');
Output:
Example 2
select week('1995-02-11');
Output:
Next TopicMySQL datetime
|