Http://hi.baidu.com/cuigq_hr/blog/item/ba2bc167ed79022eaa184c34.html
1. A summary of the dates after the Sysdate conversion:
Select To_char (sysdate, ' yyyy-mm-dd hh24:mi:ss ') today_date,--the time of the day with the seconds
(Sysdate-to_date (' 1970-01-01 ', ' yyyy-mm-dd ')) * 86400-8*3600 Todaytosecond,--today with a minute and a second date converted to seconds later
Trunc (To_date (sysdate)) Today_day,--today's accurate to the day
Trunc (To_date (sysdate + 1)) Tomorrow_day,--tomorrow the day is accurate to the day
(Trunc (To_date (sysdate))-to_date (' 1970-01-01 ', ' YYYY-MM-DD ')] *
86400 + * 3600-8*3600 tomorrow_day--tomorrow's accurate to the second
From dual
2. Second conversion day by day function
Select To_char (to_date (' 19700101 ', ' yyyymmdd ') +
1253030400/86400 + 8/24,--(1253030400 here for your time seconds of conversion all day)
' Yyyy-mm-dd hh24:MI:ss ') secondetoday
From dual
3.select To_number (to_date (' 2009-02-04 23:24:30 ', ' yyyy-mm-dd hh24:MI:ss ')-
To_date (' 2009-02-01 11:21:30 ', ' yyyy-mm-dd hh24:MI:ss '))
from dual;
4. Date type of a day converted to seconds
Select (To_date (' 2009-02-04 23:24:30 ', ' yyyy-mm-dd hh24:MI:ss ')-to_date (' 1970-01-01 ', ' yyyy-mm-dd ')) * 86400-8*3600 Moutiantosecond from dual;--a date converted to seconds after a day with a time