Oracle TIMESTAMP WITH TIMEZONE 命名区域与偏移量

Oracle TIMESTAMP WITH TIMEZONE named zone vs offset(Oracle TIMESTAMP WITH TIMEZONE 命名区域与偏移量)
本文介绍了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 命名区域与偏移量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)