date1-date2的结果是天。 select datediff(s,voteTime,getdate()) fromvoter --设置数据库中voteTitle时间和当前getdate()时间的时间差s--秒d--天