MySQL DATEDIFF()
Function
Definition and Usage
The DATEDIFF()
function returns the number of days between two dates.
Syntax
The date1
and date2
parameters are valid date or date/time expressions.
Note: Only the date parts of the values are involved in the calculation.
Example
Here is a SELECT statement:
The result is shown below:
DiffDate |
---|
1 |
Example
Here is a SELECT statement:
The result is shown below:
DiffDate |
---|
-1 |