bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL DATEDIFF() Function

Example

SELECT DATEDIFF("2017-06-25", "2017-06-15");

Definition and Usage

The DATEDIFF() function returns the number of days between two date values.

Syntax

DATEDIFF(
date1
,
date2
)

Parameter Values

ParameterDescription
date1, date2Required. Two dates to calculate the number of days between. (date1 - date2)

Technical Details

Works in:From MySQL 4.0

Previous

MySQL DATE() Function

Next

MySQL DATE_ADD() Function