SQL Language (MOSC)

MOSC Banner

to_timestamp问题

edited Dec 21, 2013 12:24AM in SQL Language (MOSC) 9 commentsAnswered
我的数据库时区是

SQL> select dbtimezone from dual;

DBTIME
------
+00:00

会话时区为

SQL> select sessiontimezone from dual;

SESSIONTIMEZONE
----------------------------------------
+08:00

但是

SQL> select to_timestamp('2007-06-28 00:00:00','yyyy-mm-dd hh24:mi:ss')  from du
al;

TO_TIMESTAMP('2007-06-2800:00:00','YYYY-MM-DDHH24:MI:SS')
---------------------------------------------------------------------------
28-6月 -07 12.00.00.000000000 上午                                                     怎么会是12点上午

SQL> select to_timestamp('2007-06-28 00:00:01','yyyy-mm-dd hh24:mi:ss')  from du
al;

TO_TIMESTAMP('2007-06-2800:00:01','YYYY-MM-DDHH24:MI:SS')
---------------------------------------------------------------------------
28-6月 -07 12.00.01.000000000 上午                                                       12点一秒

SQL> select to_timestamp('2007-06-28 12:00:00','yyyy-mm-dd hh24:mi:ss')  from du
al;

TO_TIMESTAMP('2007-06-2812:00:00','YYYY-MM-DDHH24:MI:SS')
---------------------------------------------------------------------------
28-6月 -07 12.00.00.000000000 下午                                                     12点又是下午

28-6月 -07 12.00.00.000000000 上午  代表啥意思,就是0点吗?还是有其他问题,很是奇怪。求解!

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center