在mysql中有个CONVERT_TZ函数。可以对时差进行转换。。  在oracle中也此相对应的函数吗?

解决方案 »

  1.   


    比如 时间差一天: select to_date('2001-01-01','yyyy-mm-dd')+1 from dual 
      

  2.   

    --MYSQL
    SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
    --ORACLE
    SELECT (TIMESTAMP '2004-01-01 12:00:00' at TIME ZONE 'GMT') at TIME ZONE 'MET' FROM dual;
      

  3.   

    SQL> select (timestamp '2010-04-16 14:00:00' at time zone '-08:00') at time zone
     '+08:00' from dual;(TIMESTAMP'2010-04-1614:00:00'ATTIMEZONE'-08:00')ATTIMEZONE'+08:00'
    ---------------------------------------------------------------------------
    16-4月 -10 02.00.00.000000000 下午 +08:00
    http://www.itqun.net/content-detail/255569.html