oracle时间问题

把number时间转换成字符时间
select t.NEDN,t.OBJECTINSTANCE, t.EVENTTIME,
to_date('1970-01-01 00:00:00','YYYY-MM-DD HH24:mi:ss')+t.EVENTTIME/24/60/60/1000 + 8/24 EVENTTIME ,
to_date('1970-01-01 00:00:00','YYYY-MM-DD HH24:mi:ss')+t.CLEAREDTIME/24/60/60/1000 + 8/24 CLEAREDTIME ,
to_date('1970-01-01 00:00:00','YYYY-MM-DD HH24:mi:ss')+t.ACKTIME/24/60/60/1000 + 8/24
from OMSFM.VIEW_OMSFM_ALARM_ALL t where t.ALARMID=7 and t.NEDN=''
;

把当前时间转换成number
(sysdate -TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH24:mi:ss')) * 24 * 60 * 60 * 1000

你可能感兴趣的:(oracle)