SELECT department AS 'department',
user_name AS 'user_name',
project_name AS 'project_name',
commit_id AS 'commit_id',
DATE_ADD(DATE_FORMAT(commit_date, '%Y-%m-%d %H:%i:%S'), INTERVAL 8 HOUR) AS 'commit_date'
FROM abnormalcommitmsg
WHERE TO_DAYS(NOW())-TO_DAYS(DATE_ADD(DATE_FORMAT(commit_date, '%Y-%m-%d %H:%i:%S'), INTERVAL 8 HOUR)) = 1
group by user_name
Order by department DESC
sql 格式化时间和原时间增加8小时
于 2022-07-01 10:30:37 首次发布