MySQL WEEK() Function
Definition and Usage
The WEEK() function returns the week number for a given date (a number from 0 to 53).
Syntax
WEEK(date, firstdayofweek)
Parameter Values
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:
|
Technical Details
Works in: | From MySQL 4.0 |
---|
More Examples
Example
Return the week number for the current system date:
SELECT WEEK(CURDATE());
Try it Yourself »
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.