uscdbmt@rac1:~> date +%s
1414741902
oracle中怎样把这个1414741902转换成正常时间格式
select Numtodsinterval(1414741902-TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3)) * 3600, 'second')+to_date('1970⑴⑴', 'yyyy/mm/dd') from dual;
select Numtodsinterval(1414741902⑻*3600, 'second')+to_date('1970⑴⑴', 'yyyy/mm/dd') from dual;
当前时间转换成格林尼治时间:
select (to_number(to_date('2014/10/31 15:51:42','yyyy/mm/dd hh24:mi:ss') - to_date('19700101','yyyymmdd')) * 86400)-TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3))* 3600 from dual;