Oracle 中的from_tz函数,可以将一个timstamp和timzone拼成一个timestamp with timezone
SQL> select from_tz(to_timestamp('20090102','YYYYMMDD'), 'America/Sao_Paulo') from dual;
FROM_TZ(TO_TIMESTAMP('20090102
--------------------------------------------------------------------------------
02-1月 -09 12.00.00.000000000 上午 AMERICA/SAO_PAULO
但如果这个timestamp在指定的时区内不存在(比如由于夏令时,时钟往前拨了一个小时),就会抛Exception
SQL> select from_tz(to_timestamp('20091101','YYYYMMDD'), 'America/Sao_Paulo') from dual;
select from_tz(to_timestamp('20091101','YYYYMMDD'), 'America/Sao_Paulo') from dual
ORA-01878: 在日期时间或间隔中没有找到指定的字段
解决办法嘛,先取出时区的offset,用其构建好timestamp with timezone后再转回指定的时区就好了
SQL> select from_tz(to_timestamp('20091101','YYYYMMDD'), tz_offset('America/Sao_Paulo')) at TIME ZONE 'America/Sao_Paulo' from dual;
FROM_TZ(TO_TIMESTAMP('20091101
--------------------------------------------------------------------------------
31-10月-09 11.00.00.000000000 下午 AMERICA/SAO_PAULO
分享到:
相关推荐
oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件oracle_课件
o Make Oracle_HOME $ORACLE_BASE/product/version/{db|client|companion}_[n]. Examples: /u01/app/oracle/product/11.1.0/db_1 /u01/app/oracle/product/11.1.0/client_1 /u01/app/oracle/product/10.1.0.2.0/db_1...
oracle_11g_R2_client win32 客户端
详解Oracle数据库的db_cache_size和granule_size 摘取了官方文档的描述,用中文进行了分析
本文档为cx_Oracle库使用手册,cx_Oracle库为python连接Oracle的模块
oracle goldengate 11.2.1.0.3 for oralce 11G in linux_x64
在Oracle9i中,我们可以使用DBTIMEZONE伪字段查询数据库的时区,使用 SESSIONTIMEZONE伪字段查询会话的时区。但是,对于大多数数据库,这些值都是-07:00之类的偏移值,因此对于 NEW_TIME函数是没有用的。Oracle9i...
Oracle_VM_VirtualBox_Extension_Pack-5.2.22,用于VirtualBox外接移动设备识别
2、在oracle安装路径(C:\oracle\product\10.2.0\db_1\network\ADMIN)中找tnsnames.ora 复制到C:\Oracle_instant_client_10_2路径下 3、第一次启动plsql,点击取消 设置oracle目录名为C:\Oracle_instant_client_10_2 ...
oracle goldengate 11.2.1.0.3 for oralce 11G in windows 2003 2008_x64
Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096扩展包
Oracle 中的 TO_DATE 和 TO_CHAR 函数 日期处理 Oracle 中的 TO_DATE 和 TO_CHAR 函数 日期处理
ArcGIS_10.2_直连和ArcSDE_10.2服务链接_Oracle_11g_r2_配置总结
使用VMware_Server在Oracle_Enterprise_Linux上安装Oracle_RAC_10g
Oracle_win32_11gR2_client Oracle 32位客户端 下载链接
Oracle_VM_VirtualBox_Extension_Pack-5.2.12搭建虚拟主机平台。
oracle 9i 实现wm_concat函数 进行一列多行合并,之间使用,分割
Oracle_VM_VirtualBox_Extension_Pack-4.2.16扩展包 支持所用多平台
Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack 作为Oracle_VM_VirtualBox的扩展补丁
oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典oracle_葵花宝典