Course
Simulator
More
Premium
Log in
SQL 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
DATEDIFF
(
datetime1
,
datetime2
)
Examples
MySQL
SELECT
DATEDIFF
(
'2022-12-05'
,
'2022-12-01'
)