您的位置首页百科问答 timestamp计算 Simone 发布于 2024-07-18 04:27:25 572 阅读 使用mysql自带的TIMESTAMPDIFF函数,语法为:TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2),其中unit有FRAC_SECOND , SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR。unit为SECOND就是精确到秒:TIMESTAMPDIFF(SECOND,时间列1,时间列2)