Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: internal date value
Thanks to all who replied with helpful comments, pointers, links etc...
-----Original Message-----
Sent: January 23, 2004 3:24 PM
To: Multiple recipients of list ORACLE-L
Harry
This list is moving to freelists, but I'll assume you knew that.
Actually the base value for the standard Oracle dates is Jan 1, 4712 BC. There is a Julian function that will return the number of days since the base. To return the Julian,
select to_char(sysdate,'J') from dual;
Also, Oracle9i has some new date types and you may find one that works
better for your purposes:
http://otn.oracle.com/products/oracle9i/daily/may02.html
Dennis Williams
DBA
Lifetouch, Inc.
dwilliams_at_lifetouch.com
-----Original Message-----
Sent: Friday, January 23, 2004 11:40 AM
To: Multiple recipients of list ORACLE-L
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.
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).
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).
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 - 14:54:25 CST