ans
time_to_sec(timediff(endTime, startTime))
timestampdiff(second, startTime, endTime)
unix_timestamp(endTime) -unix_timestamp(startTime)
mysql的时间相减是做了一个隐式转换操作,直接把年月日时分秒拼起来:
2022年3月27日 19:15:56
转换为 20220327191556
所以必须使用上述函数进行相减
Original: https://www.cnblogs.com/ceeSomething8/p/16063973.html
Author: cee_nil
Title: mysql时间相减获取秒数
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/712214/
转载文章受原作者版权保护。转载请注明原作者出处!