SqlServer中:
datediff()函数返回两个日期之间的天数。
datediff(datepart,startDate,endDate)
********************************************
Oracle中:
以“天”计算:round(to_bumber(endDate-startDate))
以“小时”计算:round(to_bumber(endDate-startDate)*24)
以“分钟”计算:round(to_bumber(endDate-startDate)*24*60)
以“秒”计算:round(to_bumber(endDate-startDate)*24*60*60)
以“毫秒”计算:round(to_bumber(endDate-startDate)*24*60*60*60)
可以参考:
http://www.javaeye.com/problems/9918