mysql datediff days
snippet in sql

mysql datediff days

user1727

#Get date diff in days
select DATEDIFF('2020-04-13', '2020-04-20');#returns -7
select DATEDIFF('2020-04-20', '2020-04-13');#returns  7

mysql get date diff in days

user8085

#Get date diff in days
select DATEDIFF(date1, date2) from table;