All pages
Powered by GitBook
1 of 1

Loading...

DATE FUNCTION

Extract the date part from a datetime expression. This function returns the year, month, and day portions, discarding the time component.

Syntax

DATE(expr)

Description

Extracts the date part of the date or datetime expression expr. Returns NULL and throws a warning when passed an invalid date.

Examples

This page is licensed: GPLv2, originally from

SELECT DATE('2013-07-18 12:21:32');
+-----------------------------+
| DATE('2013-07-18 12:21:32') |
+-----------------------------+
| 2013-07-18                  |
+-----------------------------+
fill_help_tables.sql