MySQL calculate the time difference function TIMESTAMPDIFF, DATEDIFF

一、TIMESTAMPDIFF

Support days, hours and seconds

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

Old_time calculated time difference between the current and hours.

二、DATEDIFF

select datediff(now(),old_time);

Guess you like

Origin www.cnblogs.com/xibuhaohao/p/11138899.html