开发者

How can I get difference of two dates through MYSQL select query

开发者 https://www.devze.com 2023-02-13 22:30 出处:网络
H开发者_如何学编程ow can I get difference of two dates (up to seconds precision) through MYSQL select query.

H开发者_如何学编程ow can I get difference of two dates (up to seconds precision) through MYSQL select query.

Can some one guide me in this regards.


Returns the difference in seconds between two dates.

SELECT TIME_TO_SEC(TIMEDIFF('2007-01-09 10:24:46','2007-01-09 10:23:46'));


You can use DATEDIFF() or TIMEDIFF()

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html

0

精彩评论

暂无评论...
验证码 换一张
取 消