有些时候,我们会遇到查询出来的时间是一堆毫秒值,它表示从1970年1月1日00点00分00秒到现在的毫秒值,这时候我们需要把它转换成我们熟悉的时间格式。

 

首先需要创建一个这样函数

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;
 
最后在我们的查询语句中
select num_to_date(t.limittime) from 表名 t
posted on 2014-01-24 14:57  月落舞絮  阅读(2520)  评论(0编辑  收藏  举报