Oracle TIMESTAMP WITH TIMEZONE named zone vs offset(Oracle TIMESTAMP WITH TIMEZONE 命名区域与偏移量)
问题描述
在oracle中,命名的时区是否总是存储的?
In oracle, is the named timezone always stored?
我一直在我们的系统中测试这个列,并且在某些地方时间戳显示为:
I have been testing this column within our system, and in some places the timestamp is shown as:
26-FEB-09 11.36.25.390713 AM +13:00
但其他时候是:
26-FEB-09 11.36.25.390713 AM Pacific/Auckland
如果该值被存储为前者,这是否意味着实际时区没有被存储?
If the value is being stored as the former, does that mean the actual timezone is not being stored?
我担心,因为如果未来日期仅存储一个偏移量,我们可能无法确定原始时区的实际时间,因为您可以确定与时区的偏移量,但反之则不行.
I worry because if a future date is stored with only an offset we might not be able to determine the actual time in the original timezone, because you can determine a offset from a timezone, but not vice versa.
谢谢
推荐答案
我发现打开连接时在 ODP.NET 中设置 TimeZone 和格式似乎可以解决这个问题:
I've found that setting the TimeZone and format within ODP.NET when a connection is opened seems to solve this problem:
OracleGlobalization info = conn.GetSessionInfo();
info.TimeZone = "Pacific/Auckland";
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
info.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR";
conn.SetSessionInfo(info);
这篇关于Oracle TIMESTAMP WITH TIMEZONE 命名区域与偏移量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Oracle TIMESTAMP WITH TIMEZONE 命名区域与偏移量


基础教程推荐
- oracle区分大小写的原因? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01