首先创建一个function:
create or replace function num_to_date(in_number NUMBER) return date is
begin
return(TO_DATE('19700101','yyyymmdd')+ in_number/86400000+TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))/24 );
end num_to_date;
而后在SQL语句中使用num_to_date(数据库字段),即可自动转换。