摘要: unix_to_oracle:create or replace function unix_to_oracle(in_number NUMBER) return date is beginreturn(TO_DATE('19700101','yyyymmdd') + in_number/86400 +TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))/24);end unix_to_oracle;oracle_to_unix:create or replace function oracle_to_unix(in 阅读全文
posted @ 2011-06-29 11:15 appleying 阅读(430) 评论(1) 推荐(0) 编辑
摘要: 按5分钟统计:select to_char((trunc(sysdate) + trunc((unix_to_oracle(C700000006) - trunc(sysdate)) * 24 * 60 / 5-1) * 5 / 60 / 24), 'yyyy-mm-dd hh24:mi') || '-' || to_char((trunc(sysdate) + trunc((unix_to_oracle(C700000006) - trunc(sysdate)) * 24 * 60 / 5 ) * 5 / 60 / 24), 'hh24:mi' 阅读全文
posted @ 2011-06-29 11:13 appleying 阅读(1409) 评论(0) 推荐(0) 编辑