一、TIMESTAMPDIFF

支持天、小时、秒等

selet TIMESTAMPDIFF(hour,odl_time,now());

计算old_time与现在时间的小时差。

二、DATEDIFF

select datediff(now(),old_time);

 posted on 2019-07-05 16:03  xibuhaohao  阅读(785)  评论(0编辑  收藏  举报