mysql get date diff in days
snippet in sql

mysql datediff days

user3014

#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

user6218

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