Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Default time not 12:00:00?

Default time not 12:00:00?

From: Todd Boss <toddboss_at_yahoo.com>
Date: 17 Apr 2003 09:02:34 -0700
Message-ID: <3fddd6bb.0304170802.6729c8fd@posting.google.com>


Apologies if this is a known issue.

What is the default time inserted to a date field, if you don't specify one? I would have assumed it was 12:00:00 (00:00:00 in 24-hour time), but look at this sequence of statements:

version: Oracle8i Release 8.1.6.1.0 - Production

SQL> create table date_test
  2 (col1 int null, col2 date null);

Table created.

SQL> insert into date_test values (1,'17-Apr-03');

1 row created.

Commit complete.
SQL> select col1, to_char(col2,'mm-dd-yyyy hh:mm:ss') from date_test;

     COL1 TO_CHAR(COL2,'MM-DD

--------- -------------------
        1 04-17-2003 12:04:00

SQL> 12:04:00?? I ran this again later and got 12:06:00 as the time entered on a different row. What is going on? The default time varies if you don't specify it?

Any insight would be appreciated.
Todd Received on Thu Apr 17 2003 - 11:02:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US