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

Home -> Community -> Mailing Lists -> Oracle-L -> internal date format

internal date format

From: Droogendyk, Harry <Harry.Droogendyk_at_cibc.com>
Date: Fri, 23 Jan 2004 09:19:34 -0800
Message-ID: <F001.005DDFCE.20040123091934@fatcity.com>


Folks:

>From what I gather, Oracle stores dates as the number of elapsed days since
Jan 1, 1968. When I query a column of type 'DATE', it returns me the default format, dd-mon-yy. I know I can use to_char(date_col,'YYYYMMDD') etc... to define many output formats.

What can I do to get the raw internal value of the date? i.e. today is 13172.

There is a real kludge I can use:

select date_field - to_date('01Jan1968','ddmonyyyy') as internal_date   from table;

Is there something built into Oracle to give me this internal format?

Thanks.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Droogendyk, Harry
  INET: Harry.Droogendyk_at_CIBC.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jan 23 2004 - 11:19:34 CST

Original text of this message

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