Mega Code Archive

 
Categories / MySQL / Date Time
 

Determine the differences between dates and times

mysql> mysql> mysql> mysql> SELECT DATEDIFF('2004-12-31 23:59:59', '2003-12-31 23:59:59'); +--------------------------------------------------------+ | DATEDIFF('2004-12-31 23:59:59', '2003-12-31 23:59:59') | +--------------------------------------------------------+ |                                                    366 | +--------------------------------------------------------+ 1 row in set (0.00 sec)