mysql datediff years code example
Example 1: mysql datediff days
#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
Example 2: calculate date and convert to yearsmysql
select date1, date2,timestampdiff(YEAR,date2,date1) from so7749639