神谕。更正时间戳与时区的偏移量
Oracle. Correct offset in timestamp with timezone
我正在执行这个 select 现在
SELECT FROM_TZ(to_timestamp('2015-08-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'),'Asia/Singapore') AT TIME ZONE 'UTC'
FROM DUAL
我对 time
很感兴趣,在这种情况下时间是 02:00 AM
,因为 Singapore
与 8 hours
中的 UTC
不同。
一切正常,但是,如果我将月份从 08
更改为 01
,我希望得到 03:00 AM
,因为 Singapore
是冬天],但我又得到了 02:00 AM。
所以问题是,我怎样才能用正确的偏移量得到正确的结果?
Asia/Singapore
没有任何夏令时,请参阅此处:Singapore Standard Time
太疯狂了,Oracle 正确地实现了这个列表:
SELECT FROM_TZ(TO_TIMESTAMP('2015-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.2015 10:00:00.000000000 +08:00
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1970-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1970 10:00:00.000000000 +07:30
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1943-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1943 10:00:00.000000000 +09:00
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1940-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1940 10:00:00.000000000 +07:20
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1920-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1920 10:00:00.000000000 +07:00
1 row selected.
我正在执行这个 select 现在
SELECT FROM_TZ(to_timestamp('2015-08-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'),'Asia/Singapore') AT TIME ZONE 'UTC'
FROM DUAL
我对 time
很感兴趣,在这种情况下时间是 02:00 AM
,因为 Singapore
与 8 hours
中的 UTC
不同。
一切正常,但是,如果我将月份从 08
更改为 01
,我希望得到 03:00 AM
,因为 Singapore
是冬天],但我又得到了 02:00 AM。
所以问题是,我怎样才能用正确的偏移量得到正确的结果?
Asia/Singapore
没有任何夏令时,请参阅此处:Singapore Standard Time
太疯狂了,Oracle 正确地实现了这个列表:
SELECT FROM_TZ(TO_TIMESTAMP('2015-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.2015 10:00:00.000000000 +08:00
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1970-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1970 10:00:00.000000000 +07:30
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1943-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1943 10:00:00.000000000 +09:00
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1940-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1940 10:00:00.000000000 +07:20
1 row selected.
SELECT FROM_TZ(TO_TIMESTAMP('1920-01-08 10:00:00', 'yyyy-mm-dd hh24:mi:ss'), 'Asia/Singapore') AS TS FROM DUAL;
TS
----------------------------------------
08.01.1920 10:00:00.000000000 +07:00
1 row selected.