DATE
Returns the date part of a datetime value, dropping the time.
MySQL 8.1
DATE(datetime)Parameters
- datetimeDATETIME
- Datetime
Return value
A date (DATE); NULL if the value is not recognized as a date
Examples
Date without the time
MySQL 8.1
SELECT DATE('2022-12-05 10:37:22');Check-in date without the time
MySQL 8.1
SELECT id,
start_date,
DATE(start_date) AS start_day
FROM Reservations;Details
DATE(NOW()) is the same as CURDATE(). To select rows for one day, it is better to compare with a range: start_date >= '2022-12-05' AND start_date < '2022-12-06'. The condition DATE(start_date) = '2022-12-05' gives the same result but cannot use an index on the column.