Calculate the number of days between two date values.
SELECT DATEDIFF(“2017-06-25”, “2017-06-15”); |
The DATEDIFF() function calculates the number of days between two date values.
DATEDIFF(date1, date2) |
Parameter |
Description |
date1, date2 |
Two dates are needed to calculate the difference in days between them: (date1 – date2). |
Works in: |
From MySQL version 4.0 |
Provide the count of days between two date values.
SELECT DATEDIFF(“2017-06-25 09:34:21”, “2017-06-15 15:25:35”); |
Calculate the number of days between two date values.
SELECT DATEDIFF(“2017-01-01”, “2016-12-24”); |