The DATEDIFF function returns the difference between two arguments as an integer representing the number of days. Arguments that can be specified are DATE, TIMESTAMP and DATETIME types and it return value is only INTEGER type.
If every argument value of date and time is 0, the return value is determined by the return_null_on_function_errors system parameter; if it is set to yes, then NULL is returned; if it is set to no, an error is returned. The default value is no.
DATEDIFF (date1, date2)
SELECT DATEDIFF('2010-2-28 23:59:59','2010-03-02');
datediff('2010-2-28 23:59:59', '2010-03-02')
===============================================
-2
SELECT DATEDIFF('0000-00-00 00:00:00', '2010-2-28 23:59:59');
ERROR: Conversion error in date format.