select TIMESTAMPDIFF(DAY, '2015-04-20 00:00:00', '2015-04-20 23:59:59');# 只要不足24小时 为0天
select TIMESTAMPDIFF(DAY, '2015-04-20 10:00:00', '2015-04-21 10:59:59');# 只要不足24小时 为0天
不足1天或1小时1分钟忽略不计
#select DATEDIFF('2015-04-21 00:00:00','2015-04-20 00:00:00'); # 1 #select DATEDIFF('2015-04-21 00:00:00','2015-04-20 01:00:00'); # 1 #select DATEDIFF('2015-04-21 23:00:00','2015-04-20 23:01:00'); # 1 #select DATEDIFF('2015-04-21 00:00:00','2015-04-20 23:01:00'); # 1
从以上测试Datediff 只计算日期部分,时间部分不算