标签:log sda code ges select zone logs col 自定义
create or replace function unix_to_oracle(in_number number) return date is begin return (to_date(‘19700101‘,‘yyyymmdd‘) + in_number/86400 + to_number(substr(tz_offset(sessiontimezone),1,3))/24); end unix_to_oracle;
select unix_to_oracle(1509490525) from dual;
create or replace function oracle_to_unix(in_date in date) return number is begin return ((in_date-to_date(‘19700101‘,‘yyyymmdd‘))*86400 - to_number(substr(tz_offset(sessiontimezone),1,3))*3600); end oracle_to_unix;
select oracle_to_unix(sysdate) from dual;
标签:log sda code ges select zone logs col 自定义
原文地址:http://www.cnblogs.com/Springmoon-venn/p/7767779.html