〇、背景
直接计算会报错
一、日期之差
1、MySQL
TIMESTAMPDIFF(SECOND,start_time,submit_time)/60 AS use_time
2、SQLServer
select datediff(d,’2020-02-24 20:59:00′,’2020-02-25 20:00:00′)
3、Pgsql
select date_part(‘day’,’2020-02-25 20:00:00′::TIMESTAMP-‘2020-02-24 20:59:00’)
版权声明:本文为USTSD原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。