MySQL DATE() Function
Definition and Usage
The DATE() function extracts the date value from a date or datetime expression.
Syntax
DATE(expression)
Parameter Values
Parameter | Description |
---|---|
expression | Required. The date/datetime value from which the date should be extracted. Returns NULL if expression is not a date or a datetime value |
Technical Details
Works in: | MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1.1 |
---|
More Examples
Example
Extract the date value (will return NULL):
SELECT DATE("The
date is 2017-06-15");
Try it Yourself »