Check out the Latest Articles:


mysql 比较时间。

有两个函数

比较天数的是DATEDIFF(expr,expr2)
SELECT DATEDIFF('1997-12-31 23:59:59','1997-12-30');
-> 1
这个比较正常。

比较秒的就比较2了

TIMEDIFF(expr,expr2)

SELECT TIMESTAMP('2003-12-31');
-> ‘2003-12-31 00:00:00’
注意,返回的是一个时间字符串。
所以要是比较秒,就的这么干

TIMEDIFF(Date1, Date2) <= “00:00:06”

有点区别哈


  1. It‘s quite in here! Why not leave a response?



0

Warning: Undefined variable $user_ID in /homepages/22/d257667558/htdocs/myblog/wordpress/wp-content/themes/magazeen/comments.php on line 86


自定义搜索