2015-06-30 23:59:60
但是,Oracle只能在一分钟内支持最多60秒:
TO_DATE( '2015-06-30 23:59:60','YYYY-MM-DD HH24:MI:SS' )
错误与:
ORA-01852: seconds must be between 0 and 59
和
SELECT TO_DATE( '2015-06-30 23:59:59','YYYY-MM-DD HH24:MI:SS' ) + INTERVAL '1' SECOND AS Incr_Second_Before,TO_DATE( '2015-07-01 00:00:00','YYYY-MM-DD HH24:MI:SS' ) - INTERVAL '1' SECOND AS Decr_Second_After FROM DUAL
给出输出:
| INCR_SECOND_BEFORE | DECR_SECOND_AFTER | |------------------------|------------------------| | July,01 2015 00:00:00 | June,30 2015 23:59:59 |
有没有办法在Oracle中处理闰秒?
Insert leap seconds into a timestamp column fails with ORA-01852 (Doc
ID 1553906.1)APPLIES TO:
Oracle Database – Enterprise Edition – Version 8.1.7.4 and later
Oracle Database – Standard Edition – Version 8.1.7.4 and later
Information in this document applies to any platform.
SYMPTOMS:
An attempt to insert leap seconds into a timestamp column,fails with:
ORA-01852: seconds must be between 0 and 59CAUSE
It is not possible to store >59 sec value in a date or timestamp
datatypeSOLUTION
To workaround this issue,the leap second record can be stored in a
varchar2 datatype instead e.g.
sql> create table test (val number,t varchar2(30));
Table created.
sql> insert into test values(123,'2012-06-30T23:59:60.000000Z');
1 row created.