Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Extracts the date part of a date or datetime expression.
DATE date(DATETIME|DATE expr)
expr
SELECT DATE("2017-12-31 11:20:59"); +-----------------------------+ | date('2017-12-31 11:20:59') | +-----------------------------+ | 2017-12-31 | +-----------------------------+ 1 row in set (0.05 sec)
SELECT DATE('2017-12-31'); +--------------------+ | date('2017-12-31') | +--------------------+ | 2017-12-31 | +--------------------+ 1 row in set (0.08 sec)
SELECT DATE(current_timestamp()); +---------------------------+ | date(current_timestamp()) | +---------------------------+ | 2022-11-08 | +---------------------------+ 1 row in set (0.05 sec)