Java或Oracle将自动为任何UTC日期应用正确的规则—当然,只要您拥有最新的时区数据文件。
既然您询问了Oracle(SGBD/RDBMS)方法并提到了Chicago,那么生成时钟在不同规则下更改的示例日期就相当简单了,并且可以看到更改应用于正确的日期(与添加到问题中的示例规则更改相比较,以及
https://www.timeanddate.com/time/zone/usa/chicago
).
alter session set nls_timestamp_tz_format = 'YYYY-MM-DD HH24:MI:SS TZH:TZM';
with t (utc) as (
select timestamp '1954-04-25 07:59:59 UTC' from dual
union all select timestamp '1954-04-25 08:00:00 UTC' from dual
union all select timestamp '1954-09-26 06:59:59 UTC' from dual
union all select timestamp '1954-09-27 07:00:00 UTC' from dual
--
union all select timestamp '1955-04-24 07:59:59 UTC' from dual
union all select timestamp '1955-04-24 08:00:00 UTC' from dual
union all select timestamp '1955-10-30 06:59:59 UTC' from dual
union all select timestamp '1955-10-30 07:00:00 UTC' from dual
--
union all select timestamp '1974-01-06 07:59:59 UTC' from dual
union all select timestamp '1974-01-06 08:00:00 UTC' from dual
union all select timestamp '1974-10-27 06:59:59 UTC' from dual
union all select timestamp '1974-10-27 07:00:00 UTC' from dual
--
union all select timestamp '1975-02-23 07:59:59 UTC' from dual
union all select timestamp '1975-02-23 08:00:00 UTC' from dual
union all select timestamp '1975-10-26 06:59:59 UTC' from dual
union all select timestamp '1975-10-26 07:00:00 UTC' from dual
--
union all select timestamp '1987-04-05 07:59:59 UTC' from dual
union all select timestamp '1987-04-05 08:00:00 UTC' from dual
union all select timestamp '1987-10-25 06:59:59 UTC' from dual
union all select timestamp '1987-10-25 07:00:00 UTC' from dual
--
union all select timestamp '2007-03-11 07:59:59 UTC' from dual
union all select timestamp '2007-03-11 08:00:00 UTC' from dual
union all select timestamp '2007-11-04 06:59:59 UTC' from dual
union all select timestamp '2007-11-04 07:00:00 UTC' from dual
)
select utc,
utc at time zone 'America/Chicago' as chicago
from t;
这给了你:
UTC CHICAGO
-------------------------- --------------------------
1954-04-25 07:59:59 +00:00 1954-04-25 01:59:59 -06:00
1954-04-25 08:00:00 +00:00 1954-04-25 03:00:00 -05:00
1954-09-26 06:59:59 +00:00 1954-09-26 01:59:59 -05:00
1954-09-27 07:00:00 +00:00 1954-09-27 01:00:00 -06:00
1955-04-24 07:59:59 +00:00 1955-04-24 01:59:59 -06:00
1955-04-24 08:00:00 +00:00 1955-04-24 03:00:00 -05:00
1955-10-30 06:59:59 +00:00 1955-10-30 01:59:59 -05:00
1955-10-30 07:00:00 +00:00 1955-10-30 01:00:00 -06:00
1974-01-06 07:59:59 +00:00 1974-01-06 01:59:59 -06:00
1974-01-06 08:00:00 +00:00 1974-01-06 03:00:00 -05:00
1974-10-27 06:59:59 +00:00 1974-10-27 01:59:59 -05:00
1974-10-27 07:00:00 +00:00 1974-10-27 01:00:00 -06:00
1975-02-23 07:59:59 +00:00 1975-02-23 01:59:59 -06:00
1975-02-23 08:00:00 +00:00 1975-02-23 03:00:00 -05:00
1975-10-26 06:59:59 +00:00 1975-10-26 01:59:59 -05:00
1975-10-26 07:00:00 +00:00 1975-10-26 01:00:00 -06:00
1987-04-05 07:59:59 +00:00 1987-04-05 01:59:59 -06:00
1987-04-05 08:00:00 +00:00 1987-04-05 03:00:00 -05:00
1987-10-25 06:59:59 +00:00 1987-10-25 01:59:59 -05:00
1987-10-25 07:00:00 +00:00 1987-10-25 01:00:00 -06:00
2007-03-11 07:59:59 +00:00 2007-03-11 01:59:59 -06:00
2007-03-11 08:00:00 +00:00 2007-03-11 03:00:00 -05:00
2007-11-04 06:59:59 +00:00 2007-11-04 01:59:59 -05:00
2007-11-04 07:00:00 +00:00 2007-11-04 01:00:00 -06:00
v$timezone_file
查看,或在最新版本中
database_properties
您可以在中阅读有关Oracle时区文件版本和修补程序的更多信息
Oracle Support Document 412160.1 (Updated DST Transitions and New Time Zones in Oracle RDBMS and OJVM Time Zone File Patches)
.
特别是,请参阅第J节“RDBMS DST更新中更新时区的列表”,其中指出:
所有时区文件更新都是累积的,这意味着较新的RDBMS DST修补程序具有以前更新的所有更改。
...
在下面的列表中,列出了在时区文件版本中更新的时区。还列出了该时区的时区规则更改的第一年和最后一年(如果适用)。
所以它显示历史日期也包括在内。