数据库中存储时间为NUMBER型,想把它转化为“yyyy-mm-dd hh:mi:ss”我写了一个方法:
create or replace function Trans_Time(msTime in integer) return varchar2 is
  Result varchar2(50);
  tempDate Date;
begin
  select to_date('1970-01-01','yyyy-mm-dd') + msTime/(1000*60*60*24) into tempDate from dual;
  Result := to_char(tempDate,'yyyy-MM-dd HH24:mi:ss');
  return(Result);
end Trans_Time;
结果样式出来了,但是显示的时间不对。
例如,应该是“2011-3-11 21:10:11”,却显示“2011-3-11 13:10:11”请大家帮忙,找找做。谁有正确的更好的请请写一下。