datediff mysql years code example Example: calculate date and convert to yearsmysql select date1, date2,timestampdiff(YEAR,date2,date1) from so7749639