Course
Simulator
More
Premium
Log in
MySQL Function Reference
Functions
DATEDIFF
DATEDIFF
Returns the difference in days between dates. When calculating the difference, the date is used, the time is not used
MySQL 8.1
DATEDIFF
(
datetime1
,
datetime2
)
Examples
MySQL 8.1
SELECT
DATEDIFF
(
'2022-12-05'
,
'2022-12-01'
)