0点0分0秒的 ,其实是当天的第一秒,例如 20130303-000000 是 20130303 当天最小的时间,还比 20130303-000000 小1秒
测试1 : 000000 - 235959 = -86399 秒
select
(to_date('20130303-000000','yyyymmdd-hh24miss') - to_date('20130303-235959','yyyymmdd-hh24miss')) *24*3600 "秒"
from dual;
秒
----------
-86399
1 row selected.
测试2:235959 - 000001 =23.9994444 小时
(to_date('20130303-235959','yyyymmdd-hh24miss') - to_date('20130303-000001','yyyymmdd-hh24miss')
) *24 "小时"
from dual;
小时
----------
23.9994444
1 row selected.
测试3:235959 - 000000 = 23.9997222 小时
(to_date('20130303-235959','yyyymmdd-hh24miss') - to_date('20130303-000000','yyyymmdd-hh24miss')
) *24 "小时"
from dual;
小时
----------
23.9997222
1 row selected.
测试4:235959 - 000000 = 86399秒
select
(to_date('20130303-235959','yyyymmdd-hh24miss') - to_date('20130303-000000','yyyymmdd-hh24miss')
) *24*3600 "秒"
from dual
秒
----------
86399
1 row selected.